From 9da00b9947fea0634a4b339aee028bf64722dfb3 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 32e1840405..0000000000 --- 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 e87b0ee328..0000000000 --- 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 5bff450aa3..52b3c952ed 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') }));