diff options
Diffstat (limited to 'vnext/server/index.js')
-rw-r--r-- | vnext/server/index.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vnext/server/index.js b/vnext/server/index.js index f9a432b9..729f05d6 100644 --- a/vnext/server/index.js +++ b/vnext/server/index.js @@ -1,4 +1,5 @@ import express from 'express'; +import config from 'config'; // we'll talk about this in a minute: import serverRenderer from './middleware/renderer'; @@ -18,9 +19,11 @@ router.get('/api/oembed', oembed); router.get('/api/urlexpand', urlExpand); router.use('^/$', serverRenderer); +const STATIC_ROOT = config.get('service.static_root') || path.resolve(__dirname, 'dist'); + // other static resources should just be served as they are router.use(express.static( - path.resolve(__dirname), + STATIC_ROOT, { maxAge: '30d' }, )); |