Serve static files from ./public
This commit is contained in:
parent
1857aa43bb
commit
242456d943
@ -19,6 +19,7 @@ use crate::{
|
|||||||
service::{Bitbucket, GitLab, Github, Service},
|
service::{Bitbucket, GitLab, Github, Service},
|
||||||
statics::{FAVICON, OPT},
|
statics::{FAVICON, OPT},
|
||||||
};
|
};
|
||||||
|
use actix_files;
|
||||||
use actix_web::{
|
use actix_web::{
|
||||||
http::header::{self, CacheControl, CacheDirective},
|
http::header::{self, CacheControl, CacheDirective},
|
||||||
middleware, web, App, Error, HttpResponse, HttpServer,
|
middleware, web, App, Error, HttpResponse, HttpServer,
|
||||||
@ -115,6 +116,7 @@ fn main() -> Result<()> {
|
|||||||
"/gitlab/{user}/{repo}/{commit}/{file:.*}",
|
"/gitlab/{user}/{repo}/{commit}/{file:.*}",
|
||||||
web::get().to_async(handle_request::<GitLab>),
|
web::get().to_async(handle_request::<GitLab>),
|
||||||
)
|
)
|
||||||
|
.service(actix_files::Files::new("/", "public").index_file("index.html"))
|
||||||
})
|
})
|
||||||
.workers(OPT.workers)
|
.workers(OPT.workers)
|
||||||
.bind((OPT.interface, OPT.port))?
|
.bind((OPT.interface, OPT.port))?
|
||||||
|
Loading…
Reference in New Issue
Block a user