1
0
mirror of https://github.com/actix/examples synced 2024-11-24 06:43:00 +01:00
examples/actix_todo
2019-06-22 13:08:45 +06:00
..
migrations Add actix-todo example 2018-09-02 10:45:06 +01:00
src Fix error message for failed connection (#144) 2019-06-22 13:08:45 +06:00
static Add actix-todo example 2018-09-02 10:45:06 +01:00
templates Add actix-todo example 2018-09-02 10:45:06 +01:00
.env Add actix-todo example 2018-09-02 10:45:06 +01:00
Cargo.toml update actix-web to 1.0.0 2019-06-06 16:47:40 +06:00
diesel.toml Add actix-todo example 2018-09-02 10:45:06 +01:00
README.md Add actix-todo example 2018-09-02 10:45:06 +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 examples/actix_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/