Template project for creating REST API's in rust
- Actix Web Server
- OpenAPI (SwaggerUI) Documentation
- SeaQL ORM
- Log with env_logger
Please install the following packages:
cargo install sea-orm-cli
cargo install cargo-watch
it is recommended that you use cargo-watch:
cargo watch -x 'run'
Please check src/env.rs for a list of environment variables.
To create database run:
# make migrate
Run:
# make dev
You should be able to access the in the browser https://localhost:9090
You should be able to access the in the browser https://localhost:9090/swagger-ui/
To check the servers health, run:
# make health
you should see successfull response eg
{
"rest_api":"Operational",
"database":"Operational"
}
To troubleshoot any issues. Please see the stdout from the dev server.
Before making pull requests, you must use cargo clippy to check that your code meets the coding standards. You can run:
# make lint
or to automatically fix style issues run:
# make fix