aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-03-08 08:27:13 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-03-08 08:37:15 +0100
commitbd324a669218f9ed302f7f54b36ee535d25c9733 (patch)
treeaebade345a240333c6f7e8e162881548c6c56dec /server.js
parent3d446a26ada901331faaaf3be9083dfe6773b50a (diff)
downloadPeerTube-bd324a669218f9ed302f7f54b36ee535d25c9733.tar.gz
PeerTube-bd324a669218f9ed302f7f54b36ee535d25c9733.tar.zst
PeerTube-bd324a669218f9ed302f7f54b36ee535d25c9733.zip
Prepare client app
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'))