A very random collection of services, packed into a RESTful Rust api. https://fej.roosens.me
 
 
 
 
 
 
Go to file
Jef Roosens 2e73d88ae9
[#13] Further overhaul of the project structure for better testing
2021-04-08 22:39:04 +02:00
.hooks Error handler now returns a string instead (closes #10) 2021-04-04 15:13:36 +02:00
benches [#13] Further overhaul of the project structure for better testing 2021-04-08 22:39:04 +02:00
src [#13] Further overhaul of the project structure for better testing 2021-04-08 22:39:04 +02:00
tests [#13] Further overhaul of the project structure for better testing 2021-04-08 22:39:04 +02: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 [#14] BasicDate now relies on DateTime for its parsing 2021-04-08 10:11:15 +02:00
Cargo.toml [#13] Further overhaul of the project structure for better testing 2021-04-08 22:39:04 +02:00
Dockerfile [#13] Further overhaul of the project structure for better testing 2021-04-08 22:39:04 +02:00
LICENSE Removed some old code; added properly formatted LICENSE 2021-03-13 10:04:49 +01:00
Makefile [#13] Further overhaul of the project structure for better testing 2021-04-08 22:39:04 +02:00
README.md Small update to readme 2021-03-13 22:11:43 +01:00
build Added working auto-tagging 2021-03-23 10:55:00 +01:00

README.md

Fej

Fej is an API written in Rust. I started this project to learn the language, and really just have some fun.

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.

Every module has a routes function that returns its route macros.