Skip to content

Commit

Permalink
fix: 404 on reload
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobrombin committed Aug 31, 2024
1 parent 068bb13 commit 0b15905
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { dirname, resolve } from "path";

import fastify from "fastify";
import fastifyStatic from "@fastify/static";
import fastifyRateLimit from "@fastify/rate-limit";
Expand All @@ -13,14 +12,16 @@ const PORT = process.env.PORT || 6090;

app.register(fastifyStatic, {
root: resolve(__dirname, "dist"),
prefix: "/",
wildcard: false,
});

app.register(fastifyRateLimit, {
max: 300,
timeWindow: "1 minute",
});

app.get("/", (req, reply) => {
app.setNotFoundHandler((req, reply) => {
reply.sendFile("index.html");
});

Expand Down

0 comments on commit 0b15905

Please sign in to comment.