From 29ae625ff0795d4efec128616714e14b1788ecf9 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 12 Jan 2023 15:39:19 -0800 Subject: bun and elysia --- Dockerfile | 1 + app.js | 7 ++++--- bun.lockb | Bin 138296 -> 121532 bytes index.js | 32 ++++++++++++++++---------------- package.json | 7 +------ 5 files changed, 22 insertions(+), 25 deletions(-) diff --git a/Dockerfile b/Dockerfile index df927f13..a2b5c2c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ ARG NODE_ENV=production ENV NODE_ENV $NODE_ENV RUN apk add --update inotify-tools vips-dev +RUN bun upgrade --canary COPY . /app WORKDIR /app diff --git a/app.js b/app.js index 89ba136b..90c45340 100644 --- a/app.js +++ b/app.js @@ -1,4 +1,5 @@ -import fastify from "fastify"; -import pino from "pino"; +import { Elysia } from 'elysia' -export default fastify({ logger: pino(), disableRequestLogging: true, maxParamLength: 500 }); +const app = new Elysia() + +export default app; diff --git a/bun.lockb b/bun.lockb index 1eca20be..8852cc08 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/index.js b/index.js index 580435e0..f3eb26b5 100644 --- a/index.js +++ b/index.js @@ -1,24 +1,24 @@ -import app from "./app"; -import { l, err } from "./lib/logging"; +import app from "app"; +// import { l, err } from "./lib/logging"; -import "./lib/redis"; -import "./lib/sockets"; -import "./lib/passport"; -import "./lib/upload"; -import "./lib/rates"; -import "./lib/notifications"; -import "./lib/mail"; -import "./lib/nostr"; +import "lib/redis"; +// import "lib/sockets"; +import "lib/passport"; +// import "lib/upload"; +import "lib/rates"; +import "lib/notifications"; +import "lib/mail"; +import "lib/nostr"; -import "./routes/locations"; -import "./routes/invoices"; -import "./routes/payments"; -import "./routes/users"; -import "./routes/requests"; +import "routes/locations"; +import "routes/invoices"; +import "routes/payments"; +import "routes/users"; +import "routes/requests"; let host = process.env.HOST || "0.0.0.0"; let port = process.env.PORT || 3119; app.listen({ host, port }, (e, h) => { - if (e) return err("Failed to start:", e.message); + // if (e) return err("Failed to start:", e.message); }); diff --git a/package.json b/package.json index 1f7f6981..3fe1b87f 100644 --- a/package.json +++ b/package.json @@ -7,15 +7,10 @@ "dev": "bun --hot index.js" }, "dependencies": { - "@fastify/multipart": "^7.1.2", - "@fastify/passport": "^2.2.0", - "@fastify/secure-session": "^5.2.0", - "@fastify/static": "^6.5.0", - "@fastify/websocket": "^7.0.1", "bcrypt": "^5.0.0", "clightning-client": "^0.1.2", "date-fns": "^2.21.3", - "fastify": "^4.5.3", + "elysia": "^0.1.2", "file-type": "^18.0.0", "got": "^12.5.3", "jsonwebtoken": "^8.5.1", -- cgit v1.2.3