main
|
Last change
on this file since b6e1b3c was 5750945, checked in by Tome <gjorgievtome@…>, 7 months ago |
|
Dockerize app
|
-
Property mode
set to
100644
|
|
File size:
619 bytes
|
| Rev | Line | |
|---|
| [8ee4553] | 1 | import "dotenv/config";
|
|---|
| 2 | import { authjsHandler, authjsSessionMiddleware } from "./authjs-handler";
|
|---|
| 3 | import { dbMiddleware } from "./db-middleware";
|
|---|
| [c30935a] | 4 | import telefuncHandler from "./telefunc-handler";
|
|---|
| [8ee4553] | 5 | import { apply, serve } from "@photonjs/hono";
|
|---|
| 6 | import { Hono } from "hono";
|
|---|
| 7 |
|
|---|
| 8 | const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000;
|
|---|
| 9 |
|
|---|
| 10 | export default startServer() as unknown;
|
|---|
| 11 |
|
|---|
| 12 | function startServer() {
|
|---|
| 13 | const app = new Hono();
|
|---|
| 14 |
|
|---|
| 15 | apply(app, [
|
|---|
| 16 | dbMiddleware,
|
|---|
| 17 |
|
|---|
| 18 | authjsSessionMiddleware,
|
|---|
| 19 |
|
|---|
| 20 | authjsHandler,
|
|---|
| 21 |
|
|---|
| 22 | telefuncHandler,
|
|---|
| 23 | ]);
|
|---|
| 24 |
|
|---|
| 25 | return serve(app, {
|
|---|
| 26 | port,
|
|---|
| [5750945] | 27 | hostname: '0.0.0.0',
|
|---|
| [8ee4553] | 28 | });
|
|---|
| 29 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.