mirror of
https://github.com/actix/examples
synced 2024-11-24 14:53:00 +01:00
8dab533b40
* Simple Todo application using Actix-web with SQLx and PostgreSQL * fix issue with not matching project name * remove comment * - downgrade on actix-web 2.0.0 - fixed typo - renamed .env-example to .env.example - removed comments
33 lines
709 B
Markdown
33 lines
709 B
Markdown
# actix-sqlx-todo
|
|
|
|
Example Todo application using Actix-web and [SQLx](https://github.com/launchbadge/sqlx) with posgresql
|
|
|
|
# Usage
|
|
|
|
## Prerequisites
|
|
|
|
* Rust
|
|
* PostgreSQL
|
|
|
|
## Change into the project sub-directory
|
|
|
|
All instructions assume you have changed into this folder:
|
|
|
|
```bash
|
|
cd examples/sqlx_todo
|
|
```
|
|
|
|
## Set up the database
|
|
|
|
* Create new database using `schema.sql`
|
|
* Copy `.env-example` into `.env` and adjust DATABASE_URL to match your PostgreSQL address, username and password
|
|
|
|
## Run the application
|
|
|
|
To run the application execute:
|
|
|
|
```bash
|
|
cargo run
|
|
```
|
|
|
|
By default application will be available on `http://localhost:5000`. If you wish to change address or port you can do it inside `.env` file |