diff options
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -66,13 +66,17 @@ app.use(require('connect-livereload')({ | |||
66 | // Catch sefaults | 66 | // Catch sefaults |
67 | require('segfault-handler').registerHandler() | 67 | require('segfault-handler').registerHandler() |
68 | 68 | ||
69 | // Static files | ||
70 | app.use(express.static(path.join(__dirname, '/client'), { maxAge: 0 })) | ||
71 | |||
72 | // API routes | 69 | // API routes |
73 | var api_route = '/api/' + constants.API_VERSION | 70 | var api_route = '/api/' + constants.API_VERSION |
74 | app.use(api_route, routes.api) | 71 | app.use(api_route, routes.api) |
75 | 72 | ||
73 | // Static files | ||
74 | app.use('/app', express.static(path.join(__dirname, '/client'), { maxAge: 0 })) | ||
75 | // 404 for static files not found | ||
76 | app.use('/app/*', function (req, res, next) { | ||
77 | res.sendStatus(404) | ||
78 | }) | ||
79 | |||
76 | // Client application | 80 | // Client application |
77 | app.use('/*', function (req, res, next) { | 81 | app.use('/*', function (req, res, next) { |
78 | res.sendFile(path.join(__dirname, 'client/index.html')) | 82 | res.sendFile(path.join(__dirname, 'client/index.html')) |