Make APIs more similar
This commit is contained in:
parent
9f0e1f8b61
commit
c40d7d056e
57 changed files with 3994 additions and 1801 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import { serve } from "@hono/node-server";
|
||||
import WhatsappService from "./service.ts";
|
||||
import { createLogger } from "@link-stack/logger";
|
||||
|
||||
import { createRoutes } from "./routes.ts";
|
||||
import { createLogger } from "./lib/logger";
|
||||
import WhatsappService from "./service.ts";
|
||||
|
||||
const logger = createLogger("bridge-whatsapp-index");
|
||||
|
||||
|
|
@ -10,7 +11,7 @@ const main = async () => {
|
|||
await service.initialize();
|
||||
|
||||
const app = createRoutes(service);
|
||||
const port = parseInt(process.env.PORT || "5000", 10);
|
||||
const port = Number.parseInt(process.env.PORT || "5000", 10);
|
||||
|
||||
serve({ fetch: app.fetch, port }, (info) => {
|
||||
logger.info({ port: info.port }, "bridge-whatsapp listening");
|
||||
|
|
@ -26,7 +27,7 @@ const main = async () => {
|
|||
process.on("SIGINT", shutdown);
|
||||
};
|
||||
|
||||
main().catch((err) => {
|
||||
logger.error(err);
|
||||
main().catch((error) => {
|
||||
logger.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue