aboutsummaryrefslogtreecommitdiffhomepage
path: root/pkgs/server/src/index.ts
blob: 6c8921750fb82cb679c6df44bf724e132702adf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { serve } from "@hono/node-server";
import { Hono } from "hono";

const app = new Hono();

app.get("/", (c) => {
	return c.json({ message: "Kioku API" });
});

app.get("/api/health", (c) => {
	return c.json({ status: "ok" });
});

const port = Number(process.env.PORT) || 3000;
console.log(`Server is running on port ${port}`);

serve({
	fetch: app.fetch,
	port,
});

export { app };