This commit is contained in:
syuilo 2017-02-13 12:59:36 +09:00
parent b18b990a79
commit b67201ba09
2 changed files with 19 additions and 13 deletions

18
src/web/about/index.ts Normal file
View file

@ -0,0 +1,18 @@
import * as express from 'express';
import ms = require('ms');
const router = express.Router();
router.use('/@/about/resources', express.static(`${__dirname}/resources`, {
maxAge: ms('7 days')
}));
router.get('/@/about/', (req, res) => {
res.sendFile(`${__dirname}/pages/index.html`);
});
router.get('/@/about/:page(*)', (req, res) => {
res.sendFile(`${__dirname}/pages/${req.params.page}.html`);
});
module.exports = router;

View file

@ -62,19 +62,7 @@ app.use(subdomain({
/**
* Routing
*/
app.use('/@/about/resources', express.static(`${__dirname}/about/resources`, {
maxAge: ms('7 days')
}));
app.get('/@/about/', (req, res) => {
res.sendFile(`${__dirname}/about/pages/index.html`);
});
app.get('/@/about/:page(*)', (req, res) => {
res.sendFile(`${__dirname}/about/pages/${req.params.page}.html`);
});
app.use(require('./about')); // about docs
app.get('/@/auth/*', serveApp('auth')); // authorize form
app.get('/@/dev/*', serveApp('dev')); // developer center
app.get('*', serveApp('client')); // client