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:
parent
3d446a26ad
commit
bd324a6692
15 changed files with 105 additions and 44 deletions
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'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue