https://github.com/orhanbalci/rocket-template
Rocket Rest api project template
https://github.com/orhanbalci/rocket-template
diesel rest-api rocket rust
Last synced: about 20 hours ago
JSON representation
Rocket Rest api project template
- Host: GitHub
- URL: https://github.com/orhanbalci/rocket-template
- Owner: orhanbalci
- License: mit
- Created: 2017-03-08T11:39:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-21T05:26:19.000Z (over 8 years ago)
- Last Synced: 2025-06-10T15:11:40.697Z (4 months ago)
- Topics: diesel, rest-api, rocket, rust
- Language: Rust
- Size: 3.5 MB
- Stars: 15
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rocket-Template
This is a REST API project template that uses [Rocket](https://github.com/SergioBenitez/Rocket) framework with [Diesel](https://github.com/diesel-rs/diesel) ORM backed up with Postgresql database. You can generate project skeleton using porteurbars.
- In order to create project you need to install [porteurbars](https://github.com/softprops/porteurbars) first.
- Run
```porteurbars orhanbalci/rocket-template your_project_directory```
- You need nightly version of Rust for [Rocket](https://github.com/SergioBenitez/Rocket).
```rustup default nightly```
- Install diesel_cli.
```
apt get install libsqlite3-dev
apt get install libmysqlclient-dev
apt get install libpq-dev
cargo install diesel_cli
```
- Run database migration from your project directory. First make sure you have a working database url in your .env file.
```disel migration run```
- Ignite your diesel powered rocket api
```cargo run```
- Skeleton code is taken from [mgattozi](https://github.com/mgattozzi/mgattozzi)