feat(web): implement web server foundation
This commit is contained in:
9
src/web/routes/health.ts
Normal file
9
src/web/routes/health.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export function healthRoute(): Response {
|
||||
return new Response(JSON.stringify({
|
||||
status: "ok",
|
||||
uptime: process.uptime(),
|
||||
timestamp: new Date().toISOString()
|
||||
}), {
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
}
|
||||
20
src/web/routes/home.ts
Normal file
20
src/web/routes/home.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { BaseLayout } from "../views/layout";
|
||||
|
||||
export function homeRoute(): Response {
|
||||
const content = `
|
||||
<div class="card">
|
||||
<h2>Welcome</h2>
|
||||
<p>The Aurora web server is up and running!</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>Status</h3>
|
||||
<p>System operational.</p>
|
||||
</div>
|
||||
`;
|
||||
|
||||
const html = BaseLayout({ title: "Home", content });
|
||||
|
||||
return new Response(html, {
|
||||
headers: { "Content-Type": "text/html" },
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user