1
0
mirror of https://github.com/actix/examples synced 2024-11-30 09:12:54 +01:00
examples/todo
yjh 89d2e4e3f7
fix typo and update some deps (#390)
* chore: fix typo for `run-in-thread`

* chore: update some deps for examples
2020-12-14 11:30:06 +00:00
..
migrations upgrade to 2.0 alpha.3 2019-12-07 23:59:24 +06:00
src Escape HTML (#366) 2020-09-14 17:02:57 +01:00
static upgrade to 2.0 alpha.3 2019-12-07 23:59:24 +06:00
templates Escape HTML (#366) 2020-09-14 17:02:57 +01:00
.env upgrade to 2.0 alpha.3 2019-12-07 23:59:24 +06:00
Cargo.toml fix typo and update some deps (#390) 2020-12-14 11:30:06 +00:00
diesel.toml upgrade to 2.0 alpha.3 2019-12-07 23:59:24 +06:00
README.md Fix directory names on READMEs (#220) 2019-12-26 19:37:34 +09: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 examples/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/