Skip to content
/ http-api-rs Public template

🦀 template for making rest api's in rust

Notifications You must be signed in to change notification settings

daniel-samson/http-api-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

🦀 template for making rest api's in rust

Topics

Resources

Stars

Watchers

Forks