Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jkcdarunday/actix-web-boilerplate
An Actix Web boilerplate with R2D2 and Diesel ORM/Migrations
https://github.com/jkcdarunday/actix-web-boilerplate
actix-web diesel-rs r2d2 r2d2-diesel rust-lang
Last synced: about 5 hours ago
JSON representation
An Actix Web boilerplate with R2D2 and Diesel ORM/Migrations
- Host: GitHub
- URL: https://github.com/jkcdarunday/actix-web-boilerplate
- Owner: jkcdarunday
- License: mit
- Created: 2019-01-19T10:32:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-30T02:16:28.000Z (about 1 year ago)
- Last Synced: 2023-08-30T09:02:59.502Z (about 1 year ago)
- Topics: actix-web, diesel-rs, r2d2, r2d2-diesel, rust-lang
- Language: Rust
- Homepage:
- Size: 129 KB
- Stars: 22
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Actix Web Boilerplate
An Actix Web boilerplate with R2D2 and Diesel ORM/Migrations support## Requirements
- Rust Stable/Nightly
- Cargo## Database Support
Currently the repository is set up to use PostgreSQL as its DBMS.
However, you can change this to other diesel-compatible DBMSes by
changing PgConnection in [src/db/mod.rs](./src/db/mod.rs) to your
preferred choice and importing necessary dependencies in Cargo.toml## Folder Structure
The following are the notable folders with their descriptions:
* [/migrations](./migrations/) - Contains your diesel migrations
* [/src/app](./src/app/) - Contains most files related to your app
* [/src/app/api](./src/app/api/) - Contains methods for handling requests
* [/src/app/db](./src/app/db/) - Contains methods for connecting to the database and setting up connection pools
* [/src/app/models](./src/app/models/) - Contains your diesel model files## Configuration
- You can set configuration variables in [config.toml](./config.toml)
- You can also configuration variables via environment variables
which will override [config.toml](./config.toml)
- You can also declare environment variables in a .env file which will get loaded by dotenv
Example of .env contents:
```
APP_LISTEN_ADDRESS=localhost:9999
APP_DATABASE_URL=postgres://user:pass@localhost:5432/dbname
```## Building
Build using cargo:
```
cargo build
```## Running
Run using cargo:
```
cargo run
```