https://github.com/jonasbindrim/rocket_notes
Template application for rocket
https://github.com/jonasbindrim/rocket_notes
rocket rust
Last synced: 5 months ago
JSON representation
Template application for rocket
- Host: GitHub
- URL: https://github.com/jonasbindrim/rocket_notes
- Owner: jonasbindrim
- License: mit
- Created: 2023-11-25T07:43:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-06T11:35:25.000Z (7 months ago)
- Last Synced: 2025-01-30T18:52:06.159Z (6 months ago)
- Topics: rocket, rust
- Language: Rust
- Homepage:
- Size: 134 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rocket Notes
This small project demonstrates how to use the Rocket framework (Version 0.5) to built a rest-api.
Thematically this project implements a simple api to store a retrieve text notes.To get information about the available endpoints, check out the `OpenApiSpec.yaml`.
## Endpoints permissions
This project uses BasicAuth to authorize access to some endpoints. Since this is only for demonstration purposes
the required access data is currently hardcoded.BasicAuth data:
Username: `username`
Password: `password`## Executing tests
When running the tests with cargo make sure to only use a single thread because all tests use the same database
which nees to be in specific states for tests to succed. Using a single thread can be done with the --test-thread argument.```Bash
cargo test -- --test-threads=1
```## Build docker container
```Bash
# The following command can be used to build the docker image
docker build . -t rocket_notes_img# After building the image the following command can be used to run the image
docker run -dit --name rocket_notes -p 80:80 rocket_notes_img
```## TODO
- [ ] Move database into a volumne in docker
- [ ] Add database migration example