diff options
author | Jake Gold <jake@blueskyweb.xyz> | 2023-05-26 17:49:58 -0700 |
---|---|---|
committer | Jake Gold <jake@blueskyweb.xyz> | 2023-05-26 17:49:58 -0700 |
commit | c98b65f6a9e6bbb31c99ff27094126e088bae6b7 (patch) | |
tree | 935f338d34157a261c4705ae28c5e30f9fd4511b /bskyweb/cmd | |
parent | 7b6948e6171b448e271f0564efd1f186ccadb9b8 (diff) | |
download | voidsky-c98b65f6a9e6bbb31c99ff27094126e088bae6b7.tar.zst |
add/serve .well-known files
Diffstat (limited to 'bskyweb/cmd')
-rw-r--r-- | bskyweb/cmd/bskyweb/.gitignore | 1 | ||||
-rw-r--r-- | bskyweb/cmd/bskyweb/server.go | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/bskyweb/cmd/bskyweb/.gitignore b/bskyweb/cmd/bskyweb/.gitignore new file mode 100644 index 000000000..45883bf13 --- /dev/null +++ b/bskyweb/cmd/bskyweb/.gitignore @@ -0,0 +1 @@ +bskyweb diff --git a/bskyweb/cmd/bskyweb/server.go b/bskyweb/cmd/bskyweb/server.go index 6daec493e..f861d58f1 100644 --- a/bskyweb/cmd/bskyweb/server.go +++ b/bskyweb/cmd/bskyweb/server.go @@ -64,6 +64,7 @@ func serve(cctx *cli.Context) error { staticHandler := http.FileServer(func() http.FileSystem { if debug { + log.Debugf("serving static file from the local file system") return http.FS(os.DirFS("static")) } fsys, err := fs.Sub(bskyweb.StaticFS, "static") @@ -100,9 +101,16 @@ func serve(cctx *cli.Context) error { RedirectCode: http.StatusFound, })) + // // configure routes + // + + // static files e.GET("/robots.txt", echo.WrapHandler(staticHandler)) e.GET("/static/*", echo.WrapHandler(http.StripPrefix("/static/", staticHandler))) + e.GET("/.well-known/assetlinks.json", echo.WrapHandler(staticHandler)) + + // home e.GET("/", server.WebHome) // generic routes |