1
0
forked from nat/sludge

Compare commits

...

2 Commits
main ... main

Author SHA1 Message Date
gnat
9e4c8ba3df add .well-known route 2024-11-20 14:41:50 -08:00
gnat
9669e09448 add route for robots.txt 2024-11-03 01:54:13 -08:00

View File

@ -90,13 +90,21 @@ routes = [
)][-1] )][-1]
), ),
Route( Route(
lambda path: os.path.isfile('.' + path.path) and (path.path.startswith('/font/') or path.path.startswith('/files/')), lambda path: os.path.isfile('.' + path.path) and (path.path.startswith('/font/') or path.path.startswith('/files/') or path.path.startswith('/.well-known/')),
[Method.GET], [Method.GET],
lambda request, *_: Response( lambda request, *_: Response(
ResponseCode.OK, ResponseCode.OK,
*raw_file_contents('.' + request.path.path) *raw_file_contents('.' + request.path.path)
) )
), ),
Route(
lambda request: request.path == '/robots.txt',
[Method.GET],
lambda *_: Response(
ResponseCode.OK,
*raw_file_contents('./robots.txt')
)
),
Route( Route(
lambda request: request.path == '/status', lambda request: request.path == '/status',
[Method.GET], [Method.GET],