File size: 690 Bytes
f9b95c0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright (C) 2025 Moew72 <Moew72@proton.me>

mod config;
mod error;
mod service;
mod sign;

use ntex::web;

use crate::{
    config::CONFIG,
    sign::{load_module, set_module_path, set_offset, unload_module},
};

#[ntex::main]
async fn main() -> std::io::Result<()> {
    set_module_path(CONFIG.module_path.clone());
    set_offset(CONFIG.offset);
    load_module();

    web::HttpServer::new(|| {
        web::App::new()
            .service(service::sign_get)
            .service(service::sign_post)
            .service(service::appinfo)
    })
    .bind(CONFIG.listen.clone())?
    .run()
    .await?;

    unload_module();

    Ok(())
}