Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dancespiele/listing_people_api_actix
https://github.com/dancespiele/listing_people_api_actix
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dancespiele/listing_people_api_actix
- Owner: dancespiele
- Created: 2018-11-20T13:35:25.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-06T17:39:34.000Z (almost 6 years ago)
- Last Synced: 2024-10-10T05:35:23.612Z (28 days ago)
- Language: Rust
- Size: 37.1 KB
- Stars: 15
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Listing people api actix
Example of application of listing people
## Run project
* set postgres
* create .env file```
DATABASE_URL=postgres://[YOUR USER]:[YOUR PASSWORD]@localhost/[YOUR DATABASE]
URL=localhost:8000
GRAPHQL_URL=localhost:8088
```* install diesel client
`cargo install diesel_cli`
* execute the migrations
`diesel setup`
`diesel migration generate create_person`* write in the file up.sql generated inside of the folde migrations/diesel_initial_setup
```sql
CREATE TABLE people (
id VARCHAR(36) PRIMARY KEY NOT NULL,
name VARCHAR(250) NOT NULL,
super_power BOOLEAN NOT NULL DEFAULT FALSE,
rich BOOLEAN NOT NULL DEFAULT FALSE,
genius BOOLEAN NOT NULL DEFAULT FALSE,
UNIQUE(name)
);
```* execute `diesel migration run`
* run `cargo run`## Test the project
`cargo test --test people_test -- --nocapture --test-threads=1`