Skip to content

Commit 0cb67b0

Browse files
committed
new env variable: PUBLIC_DIR
1 parent 203b48e commit 0cb67b0

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ Note that the API processes must be stopped and run again for new code to be eff
5454
| DB_AUTH_PASSWORD | string | db password |
5555
| DB_AUTHSOURCE | string | authentication db |
5656
| LISTEN_PORT | number | port to query the API |
57+
| HOST | string | forced hostname |
58+
| PUBLIC_DIR | string | path to public directory |
59+
5760

5861
### config.yml file
5962

src/server/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ app.use(paginate.middleware(DEFAULT_LIMIT, MAX_LIMIT));
6464
// Parse POST request bodies
6565
app.use(express.json());
6666

67+
// Set a directory for public files, if required
68+
const PUBLIC_DIR = process.env.PUBLIC_DIR;
69+
console.log(PUBLIC_DIR);
70+
if (PUBLIC_DIR)
71+
app.use('/public', express.static(PUBLIC_DIR));
72+
6773
// Root routes
6874
app.get('/', (_, res) => res.json({ 'api types': ['rest'] }));
6975
app.get('/rest', (_, res) =>

0 commit comments

Comments
 (0)