diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-03-08 08:27:13 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-03-08 08:37:15 +0100 |
commit | bd324a669218f9ed302f7f54b36ee535d25c9733 (patch) | |
tree | aebade345a240333c6f7e8e162881548c6c56dec /server.js | |
parent | 3d446a26ada901331faaaf3be9083dfe6773b50a (diff) | |
download | PeerTube-bd324a669218f9ed302f7f54b36ee535d25c9733.tar.gz PeerTube-bd324a669218f9ed302f7f54b36ee535d25c9733.tar.zst PeerTube-bd324a669218f9ed302f7f54b36ee535d25c9733.zip |
Prepare client app
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')) |