1
This commit is contained in:
parent
e22a18c364
commit
88640ac26f
@ -3,7 +3,7 @@ use std::cell::RefCell;
|
||||
use std::thread::sleep;
|
||||
use std::time::Duration;
|
||||
use tokio::runtime::Runtime;
|
||||
use actix_web::{dev::ServerHandle, middleware, rt, web, HttpRequest, HttpServer};
|
||||
use actix_web::{dev::ServerHandle, rt, web, HttpRequest, HttpServer};
|
||||
use actix_web::App as WebApp;
|
||||
use std::{sync::mpsc, thread};
|
||||
|
||||
@ -31,10 +31,15 @@ pub struct App {
|
||||
async fn run_app(port: u16, tx: mpsc::Sender<ServerHandle>) -> std::io::Result<()> {
|
||||
let server = HttpServer::new(|| {
|
||||
WebApp::new()
|
||||
.service(web::resource("/index.html").to(|| async { "Hello world!" }))
|
||||
.service(web::resource("/webapp/index.php?c=Ops&a=selfChecking").to(
|
||||
|| async
|
||||
{
|
||||
"{}"
|
||||
})
|
||||
)
|
||||
})
|
||||
.bind(("0.0.0.0", port))?
|
||||
.workers(2)
|
||||
.workers(1)
|
||||
.run();
|
||||
|
||||
let _ = tx.send(server.handle());
|
||||
|
Loading…
x
Reference in New Issue
Block a user