From c72a07187a6cebeb343fa52201577478cd2c6a6a Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 18 May 2017 05:06:55 +0900 Subject: なんかもうめっちゃ変えた MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/web/server.ts | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src/web/server.ts') diff --git a/src/web/server.ts b/src/web/server.ts index 17e455b172..d701d83b28 100644 --- a/src/web/server.ts +++ b/src/web/server.ts @@ -2,6 +2,7 @@ * Web Server */ +import * as path from 'path'; import ms = require('ms'); // express modules @@ -9,8 +10,6 @@ import * as express from 'express'; import * as bodyParser from 'body-parser'; import * as favicon from 'serve-favicon'; import * as compression from 'compression'; -const subdomain = require('subdomain'); -import serveApp from './serve-app'; import config from '../conf'; @@ -61,20 +60,13 @@ app.get('/config.json', (req, res) => { }); }); -/** - * Subdomain - */ -app.use(subdomain({ - base: config.host, - prefix: '@' -})); - /** * Routing */ -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 +app.get('*', (req, res) => { + res.sendFile(path.resolve(`${__dirname}/app/base.html`), { + maxAge: ms('7 days') + }); +}); module.exports = app; -- cgit v1.2.3-freya