neveko/src/main.rs

57 lines
1.7 KiB
Rust
Raw Normal View History

2023-04-30 15:55:41 +00:00
#[macro_use]
extern crate rocket;
2023-06-03 14:17:58 +00:00
use neveko::*;
use neveko_core::*;
use rocket::data::{
Limits,
ToByteUnit,
};
2023-04-30 15:55:41 +00:00
2023-05-08 08:02:38 +00:00
// The only changes below here should be mounting new controller methods
2023-04-30 15:55:41 +00:00
#[launch]
async fn rocket() -> _ {
let config = rocket::Config {
ident: rocket::config::Ident::none(),
ip_header: None,
limits: Limits::default().limit("json", 10_i32.mebibytes()),
2023-04-30 15:55:41 +00:00
port: utils::get_app_port(),
..rocket::Config::debug_default()
};
env_logger::init();
utils::start_up().await;
rocket::custom(&config)
2023-06-05 15:24:20 +00:00
.register(
"/",
catchers![
controller::internal_error,
controller::not_found,
controller::payment_required
],
)
.mount("/multisig/info", routes![controller::get_multisig_info])
2023-04-30 15:55:41 +00:00
.mount("/invoice", routes![controller::gen_invoice])
.mount("/message/rx", routes![controller::rx_message])
2023-06-03 05:13:56 +00:00
.mount(
"/message/rx/multisig",
routes![controller::rx_multisig_message],
)
2023-04-30 15:55:41 +00:00
.mount("/prove", routes![controller::gen_jwp])
.mount("/share", routes![controller::share_contact_info])
.mount("/i2p", routes![controller::get_i2p_status])
.mount("/xmr/rpc", routes![controller::get_version])
2023-06-03 05:13:56 +00:00
.mount(
"/market",
2023-06-05 15:24:20 +00:00
routes![
controller::create_order,
controller::create_dispute,
2023-06-11 07:56:53 +00:00
controller::get_product,
2023-06-05 15:24:20 +00:00
controller::get_products,
controller::request_shipment,
controller::retrieve_order,
2023-12-08 09:33:27 +00:00
controller::trigger_nasr,
controller::finalize_order,
2023-06-05 15:24:20 +00:00
],
2023-06-03 05:13:56 +00:00
)
2023-04-30 15:55:41 +00:00
}