mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-14 06:47:28 +00:00
fix: add root API response
This commit is contained in:
parent
9379d6eb2e
commit
4e4c78140d
2 changed files with 18 additions and 0 deletions
|
|
@ -54,6 +54,15 @@ export function createCommandBoardServer() {
|
|||
async function route(request: IncomingMessage, response: ServerResponse) {
|
||||
const url = new URL(request.url ?? "/", "http://localhost");
|
||||
|
||||
if (request.method === "GET" && url.pathname === "/") {
|
||||
json(response, 200, {
|
||||
ok: true,
|
||||
service: "commandboard-api",
|
||||
endpoints: ["/health", "/api/boards", "/api/tasks", "/api/plugins", "/api/schemas"]
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (request.method === "GET" && url.pathname === "/health") {
|
||||
json(response, 200, { ok: true, service: "commandboard-api" });
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue