diff options
Diffstat (limited to 'lib/app.js')
| -rw-r--r-- | lib/app.js | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -15,11 +15,11 @@ import { socketServer } from "$lib/sockets"; const app = fastify({ logger: pino(), disableRequestLogging: true, - maxParamLength: 500 + maxParamLength: 500, }); app.register(fastifySecureSession, { - key: Buffer.from(config.jwt, "hex") + key: Buffer.from(config.jwt, "hex"), }); app.register(fastifyPassport.initialize()); @@ -31,7 +31,7 @@ app.register(fastifyMultipart); app.register(fastifyStatic, { root: path.join("/app/data/uploads"), - prefix: "/public/" + prefix: "/public/", }); app.register(fastifyWs); @@ -39,17 +39,14 @@ app.register(socketServer); app.setErrorHandler((error, request, reply) => { if (error instanceof fastify.errorCodes.FST_ERR_BAD_STATUS_CODE) { - reply.status(500).send({ ok: false }) + reply.status(500).send({ ok: false }); } else { - reply.send(error) + reply.send(error); } -}) +}); app.setNotFoundHandler((request, reply) => { - reply - .code(404) - .type("text/html") - .send("Not Found"); + reply.code(404).type("text/html").send("Not Found"); }); export default app; |
