docs + locations
This commit is contained in:
parent
e1618b40ef
commit
48f00d8f6f
17 changed files with 390 additions and 33 deletions
13
src/main.rs
13
src/main.rs
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue