From 0ecb26187ffd59eac4a03910e9e719178110b659 Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Wed, 26 Dec 2018 12:58:20 +0100 Subject: [PATCH] Serve videos too --- Dockerfile | 1 + docker-compose.yml | 1 + package.json | 1 + server/index.js | 4 +++- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 48b2e91..3b8fb79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,5 +17,6 @@ RUN npm install --only=production # Map the volumes VOLUME /var/infoscreens/dist +VOLUME /var/infoscreens/videos CMD npm start diff --git a/docker-compose.yml b/docker-compose.yml index 3d21590..b9d19b2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,3 +13,4 @@ services: - mqtt-infoscreens volumes: - ./dist:/var/infoscreens/dist + - ./videos:/var/infoscreens/videos diff --git a/package.json b/package.json index dd0e259..7c9451f 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "isomorphic-fetch": "^2.2.1", "koa": "^2.6.2", "koa-cors": "0.0.16", + "koa-mount": "^4.0.0", "koa-router": "^7.4.0", "koa-static": "^5.0.0", "msgflo-browser": "^0.2.0", diff --git a/server/index.js b/server/index.js index e66281e..c6bd3b9 100644 --- a/server/index.js +++ b/server/index.js @@ -2,6 +2,7 @@ const Koa = require('koa'); const Router = require('koa-router'); const Static = require('koa-static'); const Cors = require('koa-cors'); +const Mount = require('koa-mount'); const path = require('path'); const route35c3 = require('./route/35c3'); @@ -15,7 +16,8 @@ app .use(Cors()) .use(router.routes()) .use(router.allowedMethods()) - .use(Static(path.resolve(__dirname, '../dist'), {})); + .use(Static(path.resolve(__dirname, '../dist'), {})) + .use(Mount('/videos', Static(path.resolve(__dirname, '../videos'), {}))); module.exports = app; if (!module.parent) {