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