Skip to content

Commit

Permalink
chore: serving base file separately
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthakpranesh committed Mar 24, 2024
1 parent 6285693 commit ca506a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ app.put('/api/:tokenRead/:tokenWrite', async (request, response) => {
return response.status(201).json({ readToken: tokenRead, writeToken: tokenWrite });
});

app.use('/*', express.static(path.join(__dirname, './ui/dist'), {}))
app.use(express.static(path.join(__dirname, './ui/dist'), {}))
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname, './ui/dist/index.html'));
});

app.listen(Number(serverPort), '0.0.0.0', () => console.log(`Listening on http://127.0.0.1:${serverPort}`));
app.listen(Number(serverPort), () => console.log(`Listening on http://127.0.0.1:${serverPort}`));

0 comments on commit ca506a1

Please sign in to comment.