✌️
This commit is contained in:
@@ -10,6 +10,9 @@ import * as express from 'express';
|
||||
import * as bodyParser from 'body-parser';
|
||||
import * as favicon from 'serve-favicon';
|
||||
import * as compression from 'compression';
|
||||
import vhost = require('vhost');
|
||||
|
||||
import config from '../conf';
|
||||
|
||||
/**
|
||||
* Init app
|
||||
@@ -17,6 +20,8 @@ import * as compression from 'compression';
|
||||
const app = express();
|
||||
app.disable('x-powered-by');
|
||||
|
||||
app.use(vhost(`docs.${config.host}`, require('./docs/server')));
|
||||
|
||||
app.use(bodyParser.urlencoded({ extended: true }));
|
||||
app.use(bodyParser.json({
|
||||
type: ['application/json', 'text/plain']
|
||||
@@ -63,12 +68,6 @@ app.get('/manifest.json', (req, res) =>
|
||||
*/
|
||||
app.get(/\/api:url/, require('./service/url-preview'));
|
||||
|
||||
/**
|
||||
* Docs
|
||||
*/
|
||||
app.get(/^\/docs\/([a-z_\-\/]+?)$/, (req, res) =>
|
||||
res.sendFile(`${__dirname}/docs/${req.params[0]}.html`));
|
||||
|
||||
/**
|
||||
* Routing
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user