1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00

Prepare client app

This commit is contained in:
Chocobozzz 2016-03-08 08:27:13 +01:00
parent 3d446a26ad
commit bd324a6692
15 changed files with 105 additions and 44 deletions

View file

@ -66,13 +66,17 @@ app.use(require('connect-livereload')({
// Catch sefaults
require('segfault-handler').registerHandler()
// Static files
app.use(express.static(path.join(__dirname, '/client'), { maxAge: 0 }))
// API routes
var api_route = '/api/' + constants.API_VERSION
app.use(api_route, routes.api)
// Static files
app.use('/app', express.static(path.join(__dirname, '/client'), { maxAge: 0 }))
// 404 for static files not found
app.use('/app/*', function (req, res, next) {
res.sendStatus(404)
})
// Client application
app.use('/*', function (req, res, next) {
res.sendFile(path.join(__dirname, 'client/index.html'))