A very random collection of services, packed into a RESTful Rust api. https://fej.roosens.me
 
 
 
 
 
 
Go to file
Jef Roosens 1ff5682fd9
Added project structure to README
2021-03-11 12:16:28 +01:00
src Started search functionality 2021-03-06 00:25:40 +01:00
.dockerignore Added Docker build files 2021-03-05 20:40:49 +01:00
.gitignore Added cargo init 2021-03-05 18:39:49 +01:00
Cargo.lock Added rocket hello world code 2021-03-05 18:55:18 +01:00
Cargo.toml Added rocket hello world code 2021-03-05 18:55:18 +01:00
Dockerfile Added Docker build files 2021-03-05 20:40:49 +01:00
LICENSE Initial commit 2021-03-04 10:55:24 +00:00
Makefile Added first unit tests 2021-03-05 23:45:56 +01:00
README.md Added project structure to README 2021-03-11 12:16:28 +01:00

README.md

rust-api

An API written in Rust, which I used to learn the language.

Project Structure

The folder structure follows the structure of the URLs, e.g. the route for /hello/world is found in the module src/hello.

Each module contains the following base files:

  • mod.rs: defines the modules' content, and contains the route definitions. The route functions themselves only contain the functionality needed to represent the data, not acquire it.
  • controller.rs: this file contains the actual logic of each route. If the logic becomes too complicated to be contained inside a single file, controller.rs becomes its own module folder named controller.
  • tests.rs: this contains tests for the specific module. This can also be a module directory if need be.