mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Prepare client app
This commit is contained in:
10
server.js
10
server.js
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user