docs + locations

This commit is contained in:
JMARyA 2024-09-02 18:40:02 +02:00
parent e1618b40ef
commit 48f00d8f6f
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
17 changed files with 390 additions and 33 deletions

View file

@ -1,8 +1,15 @@
use std::ops::Deref;
use json_store::JSONStore;
use location::Location;
use mongod::Model;
use rocket::routes as route;
use rocket::{http::Method, launch};
mod db;
mod item;
mod json_store;
mod location;
mod process;
mod routes;
mod transaction;
@ -41,6 +48,11 @@ async fn rocket() -> _ {
.expect("error creating CORS options");
let itemdb = db::ItemDB::new("./itemdb").await;
let locations: JSONStore<Location> = JSONStore::new("./locations");
for location in locations.deref() {
location.1.insert_overwrite().await.unwrap();
}
rocket::build()
.mount(
@ -60,5 +72,6 @@ async fn rocket() -> _ {
],
)
.manage(itemdb)
.manage(locations)
.attach(cors)
}