Add static endpoint
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
//use bcrypt::{hash, verify, DEFAULT_COST};
|
||||
use futures_util::{SinkExt, StreamExt};
|
||||
use poem::{
|
||||
endpoint::StaticFilesEndpoint,
|
||||
//get,
|
||||
handler,
|
||||
listener::TcpListener,
|
||||
@@ -289,6 +290,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
"Chat",
|
||||
"0.0",
|
||||
);
|
||||
let static_endpoint = StaticFilesEndpoint::new("./client/dist").index_file("index.html");
|
||||
|
||||
let app = Route::new()
|
||||
//.at("/api/", get(index))
|
||||
@@ -297,6 +299,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
// get(ws.data(tokio::sync::broadcast::channel::<String>(32).0)),
|
||||
//)
|
||||
//.data(dbpool)
|
||||
.nest("/", static_endpoint)
|
||||
.nest("/api", api)
|
||||
.with(session);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user