1
0
mirror of https://github.com/actix/examples synced 2024-11-23 22:41:07 +01:00
examples/basics/todo
2022-02-02 01:43:51 +00:00
..
migrations Restructure folders (#411) 2021-02-26 00:57:58 +00:00
src Restructure folders (#411) 2021-02-26 00:57:58 +00:00
static Restructure folders (#411) 2021-02-26 00:57:58 +00:00
templates Restructure folders (#411) 2021-02-26 00:57:58 +00:00
.env Restructure folders (#411) 2021-02-26 00:57:58 +00:00
Cargo.toml edition = 2021 2022-02-02 01:43:51 +00:00
diesel.toml Restructure folders (#411) 2021-02-26 00:57:58 +00:00
README.md fix broken links (#441) 2021-10-06 22:28:53 +01:00

actix-todo

A port of the Rocket Todo example into actix-web. Except this uses PostgreSQL instead of SQLite.

Usage

Prerequisites

  • Rust >= 1.26
  • PostgreSQL >= 9.5

Change into the project sub-directory

All instructions assume you have changed into this folder:

cd basics/todo

Set up the database

Install the diesel command-line tool including the postgres feature:

cargo install diesel_cli --no-default-features --features postgres

Check the contents of the .env file. If your database requires a password, update DATABASE_URL to be of the form:

DATABASE_URL=postgres://username:password@localhost/actix_todo

Then to create and set-up the database run:

diesel database setup

Run the application

To run the application execute:

cargo run

Then to view it in your browser navigate to: http://localhost:8088/