mirror of
https://github.com/pawelmalak/flame.git
synced 2025-06-28 17:23:03 -04:00
Docker build. Catch client routes on server. Initial config utility
This commit is contained in:
parent
d2e6ebae4f
commit
1636b705de
10 changed files with 125 additions and 13 deletions
7
api.js
7
api.js
|
@ -1,10 +1,13 @@
|
|||
const path = require('path');
|
||||
const express = require('express');
|
||||
const errorHandler = require('./middleware/errorHandler');
|
||||
|
||||
const api = express();
|
||||
|
||||
api.get('/', (req, res) => {
|
||||
res.send('Server is working');
|
||||
// Static files
|
||||
api.use(express.static(path.join(__dirname, 'public')));
|
||||
api.get(/^\/(?!api)/, (req, res) => {
|
||||
res.sendFile(path.join(__dirname, 'public/index.html'));
|
||||
})
|
||||
|
||||
// Body parser
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue