Skip to content

Commit

Permalink
Make the listening host configurable (zotero#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
wetneb authored and dstillman committed Apr 1, 2019
1 parent 083f239 commit 7c6a2df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"deproxifyURLs": false, // Automatically try deproxified versions of URLs
"identifierSearchLambda": "", // Identifier search Lambda function for text search
"port": 1969,
"host": "0.0.0.0", // host to listen on
"textSearchTimeout": 5,
"translators": {
"CrossrefREST.email": "" // Pass an email to Crossref REST API to utilize the faster servers pool
Expand Down
5 changes: 3 additions & 2 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Translators.init()
if (process.env.NODE_ENV == 'test') return;

var port = config.get('port');
app.listen(port);
Debug.log(`Listening on 0.0.0.0:${port}`);
var host = config.get('host');
app.listen(port, host);
Debug.log(`Listening on ${host}:${port}`);
});

0 comments on commit 7c6a2df

Please sign in to comment.