Add fallback route for well-known paths
This commit is contained in:
parent
2dda00e36c
commit
eb825bca04
1 changed files with 9 additions and 2 deletions
11
src/main.rs
11
src/main.rs
|
@ -4,7 +4,9 @@ use actix_web::{
|
||||||
http::Method,
|
http::Method,
|
||||||
middleware::Logger as ActixLogger,
|
middleware::Logger as ActixLogger,
|
||||||
web,
|
web,
|
||||||
App, HttpServer,
|
App,
|
||||||
|
HttpResponse,
|
||||||
|
HttpServer,
|
||||||
};
|
};
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
|
||||||
|
@ -160,7 +162,12 @@ async fn main() -> std::io::Result<()> {
|
||||||
.service(nodeinfo::get_nodeinfo)
|
.service(nodeinfo::get_nodeinfo)
|
||||||
.service(nodeinfo::get_nodeinfo_2_0)
|
.service(nodeinfo::get_nodeinfo_2_0)
|
||||||
.service(web_client::profile_page_redirect())
|
.service(web_client::profile_page_redirect())
|
||||||
.service(web_client::post_page_redirect());
|
.service(web_client::post_page_redirect())
|
||||||
|
.service(
|
||||||
|
// Fallback for well-known paths
|
||||||
|
web::resource("/.well-known/{path}")
|
||||||
|
.to(HttpResponse::NotFound)
|
||||||
|
);
|
||||||
if let Some(blockchain_config) = config.blockchain() {
|
if let Some(blockchain_config) = config.blockchain() {
|
||||||
if let Some(ethereum_config) = blockchain_config.ethereum_config() {
|
if let Some(ethereum_config) = blockchain_config.ethereum_config() {
|
||||||
// Serve artifacts if available
|
// Serve artifacts if available
|
||||||
|
|
Loading…
Reference in a new issue