Skip to content

Commit

Permalink
Add assetlinks.json
Browse files Browse the repository at this point in the history
  • Loading branch information
JElgar committed Sep 2, 2024
1 parent d714ca1 commit 6048c59
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/assetlinks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.nowu.app",
"sha256_cert_fingerprints": ["C1:F6:16:4B:40:EC:A9:6E:B7:D1:38:2D:C3:FC:B9:D9:F6:E3:D8:23:AD:01:A2:CD:84:14:C7:59:48:7C:35:90"]
}
}]
10 changes: 9 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::env;

use link_router::create_link_router_service;
use management::create_management_service;
use poem::{listener::TcpListener, EndpointExt, Result, Route};
use poem::{endpoint::make_sync, get, listener::TcpListener, EndpointExt, Response, Result, Route};
use tracing::info;
use url::Url;

Expand Down Expand Up @@ -54,6 +54,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

info!("Creating app");
let app = Route::new()
.at(
"/.well-known/assetlinks.json",
get(make_sync(move |_| {
Response::builder()
.content_type("application/json")
.body(include_str!("assetlinks.json"))
})),
)
.nest("/api", create_management_service(&base_url))
.nest("/", create_link_router_service())
.data(AppContext {
Expand Down

0 comments on commit 6048c59

Please sign in to comment.