From 784533cb11716831b0b640d8a4f068fbf4b627dd Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 9 Feb 2017 05:23:01 +0900 Subject: [PATCH] Refactor --- src/web/apple-touch-icon.ts | 8 -------- src/web/manifest.ts | 6 ------ src/web/server.ts | 4 ++-- 3 files changed, 2 insertions(+), 16 deletions(-) delete mode 100644 src/web/apple-touch-icon.ts delete mode 100644 src/web/manifest.ts diff --git a/src/web/apple-touch-icon.ts b/src/web/apple-touch-icon.ts deleted file mode 100644 index 32e184040..000000000 --- a/src/web/apple-touch-icon.ts +++ /dev/null @@ -1,8 +0,0 @@ -import * as path from 'path'; -import * as express from 'express'; - -const app = express.Router(); -app.get('/apple-touch-icon.png', (req, res) => - res.sendFile(path.resolve(__dirname + '/../../resources/apple-touch-icon.png'))); - -module.exports = app; diff --git a/src/web/manifest.ts b/src/web/manifest.ts deleted file mode 100644 index e87b0ee32..000000000 --- a/src/web/manifest.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as express from 'express'; - -const app = express.Router(); -app.get('/manifest.json', (req, res) => res.sendFile(__dirname + '/../../resources/manifest.json')); - -module.exports = app; diff --git a/src/web/server.ts b/src/web/server.ts index 5bff450aa..52b3c952e 100644 --- a/src/web/server.ts +++ b/src/web/server.ts @@ -35,8 +35,8 @@ app.use((req, res, next) => { * Static resources */ app.use(favicon(`${__dirname}/resources/favicon.ico`)); -app.use(require('./manifest')); -app.use(require('./apple-touch-icon')); +app.get('/manifest.json', (req, res) => res.sendFile(__dirname + '/resources/manifest.json')); +app.get('/apple-touch-icon.png', (req, res) => res.sendFile(__dirname + '/resources/apple-touch-icon.png')); app.use('/_/resources', express.static(`${__dirname}/resources`, { maxAge: ms('7 days') }));