Skip to content

Latest commit

 

History

History
93 lines (63 loc) · 1.88 KB

README.md

File metadata and controls

93 lines (63 loc) · 1.88 KB

http-api-rs

Template project for creating REST API's in rust

Features

  • Actix Web Server
  • OpenAPI (SwaggerUI) Documentation
  • SeaQL ORM
  • Log with env_logger

Project Status

CI

Development

Pre-requisites

Please install the following packages:

cargo install sea-orm-cli
cargo install cargo-watch

Watch for changes

it is recommended that you use cargo-watch:

cargo watch -x 'run'

Environment variables

Please check src/env.rs for a list of environment variables.

Set up database

To create database run:

# make migrate

Dev server

Run:

# make dev

You should be able to access the in the browser http://localhost:9090

Swagger Docs

You should be able to access the in the browser http://localhost:9090/swagger-ui/

Healthcheck

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.

Lint

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

Documentation