diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-31 18:12:15 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-05 08:43:01 +0200 |
commit | 989e526abf0c0dd7958deb630df009608561bb67 (patch) | |
tree | 5d948bf953a7006b1d6b8c34fb03da1df612a50f /server.ts | |
parent | 1dd59831f80ff4d49f3b60c8c3b2aabfb1512eeb (diff) | |
download | PeerTube-989e526abf0c0dd7958deb630df009608561bb67.tar.gz PeerTube-989e526abf0c0dd7958deb630df009608561bb67.tar.zst PeerTube-989e526abf0c0dd7958deb630df009608561bb67.zip |
Prepare i18n files
Diffstat (limited to 'server.ts')
-rw-r--r-- | server.ts | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -12,7 +12,6 @@ import * as bodyParser from 'body-parser' | |||
12 | import * as express from 'express' | 12 | import * as express from 'express' |
13 | import * as http from 'http' | 13 | import * as http from 'http' |
14 | import * as morgan from 'morgan' | 14 | import * as morgan from 'morgan' |
15 | import * as path from 'path' | ||
16 | import * as bitTorrentTracker from 'bittorrent-tracker' | 15 | import * as bitTorrentTracker from 'bittorrent-tracker' |
17 | import * as cors from 'cors' | 16 | import * as cors from 'cors' |
18 | import { Server as WebSocketServer } from 'ws' | 17 | import { Server as WebSocketServer } from 'ws' |
@@ -156,20 +155,11 @@ app.use('/', activityPubRouter) | |||
156 | app.use('/', feedsRouter) | 155 | app.use('/', feedsRouter) |
157 | app.use('/', webfingerRouter) | 156 | app.use('/', webfingerRouter) |
158 | 157 | ||
159 | // Client files | ||
160 | app.use('/', clientsRouter) | ||
161 | |||
162 | // Static files | 158 | // Static files |
163 | app.use('/', staticRouter) | 159 | app.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! |
166 | app.use('/*', function (req, res) { | 162 | app.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 | ||