mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-15 06:27:34 -07:00
Refactor
This commit is contained in:
parent
b18b990a79
commit
b67201ba09
2 changed files with 19 additions and 13 deletions
18
src/web/about/index.ts
Normal file
18
src/web/about/index.ts
Normal 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;
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue