source: server/entry.ts@ 8849e3b

main
Last change on this file since 8849e3b was c30935a, checked in by Tome <gjorgievtome@…>, 7 months ago

fix config

  • Property mode set to 100644
File size: 813 bytes
Line 
1import "dotenv/config";
2import { authjsHandler, authjsSessionMiddleware } from "./authjs-handler";
3import { dbMiddleware } from "./db-middleware";
4import telefuncHandler from "./telefunc-handler";
5import { apply, serve } from "@photonjs/hono";
6import { Hono } from "hono";
7
8const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000;
9
10export default startServer() as unknown;
11
12function startServer() {
13 const app = new Hono();
14
15 apply(app, [
16 // Make database available in Context as `context.db`
17 dbMiddleware,
18
19 // Append Auth.js session to context
20 authjsSessionMiddleware,
21
22 // Auth.js route. See https://authjs.dev/getting-started/installation
23 authjsHandler,
24
25 // Telefunc route. See https://telefunc.com
26 telefuncHandler,
27 ]);
28
29 return serve(app, {
30 port,
31 });
32}
Note: See TracBrowser for help on using the repository browser.