import { Hono } from "hono";
import { serve } from '@hono/node-server';
export default async function setupServer(client) {
const app = new Hono();
app.get("/", async (c) => {
return c.json({ message: "Gwapes's API: Version 1" }, 200);
});
app.notFound(async (c) => {
console.log(c.req.url);
return c.json({ message: "Not found" }, 404);
});
// const voteApp = voting(client);
// app.route("/voting", voteApp);
// app.route("/", userApp);
serve({
fetch: (req, env) => {
console.log(req.url, "logging url");
req.headers.forEach((val, key) => console.log(key, val));
return app.fetch(req, env);
},
port: 69,
}, (info) => console.log("Listening on port " + info));
};
import { Hono } from "hono";
import { serve } from '@hono/node-server';
export default async function setupServer(client) {
const app = new Hono();
app.get("/", async (c) => {
return c.json({ message: "Gwapes's API: Version 1" }, 200);
});
app.notFound(async (c) => {
console.log(c.req.url);
return c.json({ message: "Not found" }, 404);
});
// const voteApp = voting(client);
// app.route("/voting", voteApp);
// app.route("/", userApp);
serve({
fetch: (req, env) => {
console.log(req.url, "logging url");
req.headers.forEach((val, key) => console.log(key, val));
return app.fetch(req, env);
},
port: 69,
}, (info) => console.log("Listening on port " + info));
};