diff --git a/server.mjs b/server.mjs index 92ab7ff..e441784 100755 --- a/server.mjs +++ b/server.mjs @@ -9,11 +9,11 @@ import { handler as ssrHandler } from './dist/server/entry.mjs' const app = Fastify({ logger: true }) await app - .register(import('@fastify/rate-limit'), { - global: true, - max: 25, - timeWindow: 1000 * 60 * 5, - }) + // .register(import('@fastify/rate-limit'), { + // global: true, + // max: 25, + // timeWindow: 1000 * 60 * 5, + // }) .register(fastifyStatic, { root: fileURLToPath(new URL('./dist/client', import.meta.url)), }) @@ -21,21 +21,21 @@ await app app.use(ssrHandler) -await app.setNotFoundHandler( - { - preHandler: app.rateLimit(), - }, - function (request, reply) { - reply.code(404).send({ nothing: 'to see here' }) - } -) +// await app.setNotFoundHandler( +// { +// preHandler: app.rateLimit(), +// }, +// function (request, reply) { +// reply.code(404).send({ nothing: 'to see here' }) +// } +// ) -await app.setErrorHandler(function (error, request, reply) { - if (error.statusCode === 429) { - reply.code(429) - error.message = 'You hit the rate limit! Slow down please!' - } - reply.send(error) -}) +// await app.setErrorHandler(function (error, request, reply) { +// if (error.statusCode === 429) { +// reply.code(429) +// error.message = 'You hit the rate limit! Slow down please!' +// } +// reply.send(error) +// }) app.listen({ port: 4321 })