add flags readout route to /population~/flags
This commit is contained in:
parent
71004e5e79
commit
003a78bccd
1 changed files with 14 additions and 0 deletions
14
src/index.ts
14
src/index.ts
|
@ -19,6 +19,20 @@ router
|
||||||
.get<BasicRouter>("/population/", index)
|
.get<BasicRouter>("/population/", index)
|
||||||
.get<BasicRouter>("/population/all", handleAll)
|
.get<BasicRouter>("/population/all", handleAll)
|
||||||
.get<BasicRouter>("/population/:id", handleOne)
|
.get<BasicRouter>("/population/:id", handleOne)
|
||||||
|
.get<BasicRouter>(
|
||||||
|
"/population~/flags",
|
||||||
|
(_1, _2, _3, cache: Cache, flags: Flags) => {
|
||||||
|
return new Response(
|
||||||
|
JSON.stringify({
|
||||||
|
...flags,
|
||||||
|
disableCache: cache.disableCache,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
headers: { "content-type": "application/json" },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
)
|
||||||
.all<BasicRouter>("*", () => {
|
.all<BasicRouter>("*", () => {
|
||||||
return new Response("Not found", {
|
return new Response("Not found", {
|
||||||
headers: { "content-type": "text/plain" },
|
headers: { "content-type": "text/plain" },
|
||||||
|
|
Loading…
Add table
Reference in a new issue