diff options
author | Vitaly Takmazov | 2022-10-30 01:51:42 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:58 +0300 |
commit | 657af5906ed50acc9bacea487ac22b6c9c961571 (patch) | |
tree | 9804a63b7aa897fa2fec782b99a76f2e3f4f272b /vnext/server/index.js | |
parent | 62f9875418444274c8aa3785ea913677c203e840 (diff) |
Read static root from the config
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' }, )); |