Skip to content

Commit

Permalink
Add correct routes for the sub pages
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarneo committed Jun 13, 2021
1 parent 0f45761 commit e991528
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ if (process.env.NODE_ENV !== 'development') {
root: staticPath,
route: '/*',
});
}

fastify.get('/secret/*', function (_, reply) {
return reply.sendFile('index.html');
});
function serveIndex(_, reply) {
return reply.sendFile('index.html');
}

fastify.get('/secret/*', serveIndex);
fastify.get('/about', serveIndex);
fastify.get('/privacy', serveIndex);
fastify.get('/api', serveIndex);
}

const startServer = async () => {
try {
Expand Down

0 comments on commit e991528

Please sign in to comment.