From dd72abae012fde8c69086900bf387db5362c3987 Mon Sep 17 00:00:00 2001 From: Sean Matheson Date: Mon, 8 Aug 2016 15:37:41 +0100 Subject: [PATCH] Adds a 'public' static files endpoint, with a favicon implementation. Closes #14 --- public/favicon.ico | Bin 0 -> 1150 bytes src/server/htmlPage/render.js | 1 + src/server/index.js | 7 +++++++ 3 files changed, 8 insertions(+) create mode 100644 public/favicon.ico diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..dfe5b3404d4578d25b715b843f7899fa1a7d027f GIT binary patch literal 1150 zcma)4yGjF55Iqv{0a1dAn4o4|5$s}NFCtX(h*&ACGs=<6aMxs)*)#V%hI@Ax7?L}egFFKq4g<3QR;7dz=9d=$L>uIq%4RaH zcsa2(NY-Y2>$EwgU~DqYZ+YL0+v;M)`dYQ{ie9UcSF{?}&3NgUzEUv0MqZJ;^lg{d zz8=j*^(cQ&4^gyt*Q>m{)}CG;`n;CA+$%)BY&#A+%FBDs9_`NL>9P6$_E27*7-7yu zJ3}>xdv?8UA6Ao}^E%$Y|IYQL^}$I}))~IMa%nm8nstkFny29%^MW7r`;cegK8T!U z(asQmLo + ${helmet && helmet.title.toString()} ${helmet && helmet.meta.toString()} diff --git a/src/server/index.js b/src/server/index.js index c2319b78b24ea1..48658f0c7588d7 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -7,6 +7,7 @@ import express from 'express'; import compression from 'compression'; import hpp from 'hpp'; import helmet from 'helmet'; +import path from 'path'; import universalReactAppMiddleware from './middleware/universalReactApp'; import clientConfigBuilder from '../../webpack.client.config.js'; @@ -46,6 +47,12 @@ app.use( express.static(webpackClientConfig.output.path) ); +// Configure static serving of our "public" static files. +app.use( + '/public/', + express.static(path.resolve(__dirname, '../../public')) +); + // Bind our universal react app middleware as the handler for all get requests. app.get('*', universalReactAppMiddleware);