mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Replace rc_static_data with general CDN implementation
This commit is contained in:
1 parent
4f0bcde7d8
commit
e7de53929d
16 files changed
+553
-141
No files matched your search
@@ -0,0 +1,29 @@
|
||||
mod cli;
|
||||
mod robocraft;
|
||||
|
||||
use actix_web::{App, HttpServer, Responder};
|
||||
|
||||
#[actix_web::get("/")]
|
||||
async fn index() -> impl Responder {
|
||||
let name = env!("CARGO_PKG_NAME");
|
||||
let version = env!("CARGO_PKG_VERSION");
|
||||
let authors = env!("CARGO_PKG_AUTHORS");
|
||||
let license = env!("CARGO_PKG_LICENSE");
|
||||
let repo = env!("CARGO_PKG_REPOSITORY");
|
||||
format!("{} {} by [{}]\n{}\n{}", name, version, authors, license, repo)
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
let cli_args = cli::CliArgs::get();
|
||||
let cli_args2 = cli_args.clone();
|
||||
HttpServer::new(move || {
|
||||
App::new()
|
||||
.app_data(actix_web::web::Data::new(cli_args2.clone()))
|
||||
.service(index)
|
||||
.service(robocraft::live_data::live_data_json)
|
||||
})
|
||||
.bind((cli_args.ip, cli_args.port))?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
Reference in new issue
Block a user