aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-31 18:12:15 +0200
committerChocobozzz <me@florianbigard.com>2018-06-05 08:43:01 +0200
commit989e526abf0c0dd7958deb630df009608561bb67 (patch)
tree5d948bf953a7006b1d6b8c34fb03da1df612a50f /server.ts
parent1dd59831f80ff4d49f3b60c8c3b2aabfb1512eeb (diff)
downloadPeerTube-989e526abf0c0dd7958deb630df009608561bb67.tar.gz
PeerTube-989e526abf0c0dd7958deb630df009608561bb67.tar.zst
PeerTube-989e526abf0c0dd7958deb630df009608561bb67.zip
Prepare i18n files
Diffstat (limited to 'server.ts')
-rw-r--r--server.ts14
1 files changed, 2 insertions, 12 deletions
diff --git a/server.ts b/server.ts
index bdcbb7988..c0e679b02 100644
--- a/server.ts
+++ b/server.ts
@@ -12,7 +12,6 @@ import * as bodyParser from 'body-parser'
12import * as express from 'express' 12import * as express from 'express'
13import * as http from 'http' 13import * as http from 'http'
14import * as morgan from 'morgan' 14import * as morgan from 'morgan'
15import * as path from 'path'
16import * as bitTorrentTracker from 'bittorrent-tracker' 15import * as bitTorrentTracker from 'bittorrent-tracker'
17import * as cors from 'cors' 16import * as cors from 'cors'
18import { Server as WebSocketServer } from 'ws' 17import { Server as WebSocketServer } from 'ws'
@@ -156,20 +155,11 @@ app.use('/', activityPubRouter)
156app.use('/', feedsRouter) 155app.use('/', feedsRouter)
157app.use('/', webfingerRouter) 156app.use('/', webfingerRouter)
158 157
159// Client files
160app.use('/', clientsRouter)
161
162// Static files 158// Static files
163app.use('/', staticRouter) 159app.use('/', staticRouter)
164 160
165// Always serve index client page (the client is a single page application, let it handle routing) 161// Client files, last valid routes!
166app.use('/*', function (req, res) { 162app.use('/', clientsRouter)
167 if (req.accepts(ACCEPT_HEADERS) === 'html') {
168 return res.sendFile(path.join(__dirname, '../client/dist/index.html'))
169 }
170
171 return res.status(404).end()
172})
173 163
174// ----------- Errors ----------- 164// ----------- Errors -----------
175 165