fallback route & dep updates

This commit is contained in:
2022-03-05 12:47:11 +01:00
parent e02f7f59c6
commit d576b71bc5
10 changed files with 308 additions and 236 deletions

2
backend/Cargo.lock generated
View File

@@ -398,7 +398,7 @@ dependencies = [
[[package]]
name = "cryptgeon"
version = "1.4.0"
version = "1.4.1"
dependencies = [
"actix-files",
"actix-web",

View File

@@ -1,6 +1,6 @@
[package]
name = "cryptgeon"
version = "1.4.0"
version = "1.4.1"
authors = ["cupcakearmy <hi@nicco.io>"]
edition = "2021"

View File

@@ -1,5 +1,5 @@
use actix_files::Files;
use actix_web::web;
use actix_files::{Files, NamedFile};
use actix_web::{web, Result};
pub fn init(cfg: &mut web::ServiceConfig) {
cfg.service(
@@ -8,3 +8,7 @@ pub fn init(cfg: &mut web::ServiceConfig) {
.use_etag(true),
);
}
pub async fn index() -> Result<NamedFile> {
Ok(NamedFile::open("./frontend/build/index.html")?)
}

View File

@@ -1,4 +1,4 @@
use actix_web::{middleware, App, HttpServer};
use actix_web::{middleware, web, App, HttpServer};
use dotenv::dotenv;
#[macro_use]
@@ -22,6 +22,7 @@ async fn main() -> std::io::Result<()> {
.configure(size::init)
.configure(api::init)
.configure(client::init)
.default_service(web::to(client::index))
})
.bind("0.0.0.0:5000")?
.run()