Skip to content

Commit

Permalink
added a config setting called root for the correct root url from outside
Browse files Browse the repository at this point in the history
  • Loading branch information
punkish committed May 8, 2020
1 parent e9f1051 commit 4a4675a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion api/v2/resources/rootRoute.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
'use strict';

const config = require('config');
const root = config.get('root');

/*************************************************************
*
* This is the root of the API. It lists all the routes to the
Expand Down Expand Up @@ -32,7 +35,7 @@ module.exports = {
return {
name: name,
description: description,
path: `${server.info.uri}${path}`
path: `${root}${path}`
}
});

Expand Down
1 change: 1 addition & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {

// The port can change depending on the server
port: 3030,
root: 'http://localhost:3030',

loglevel: 'INFO',

Expand Down
3 changes: 1 addition & 2 deletions config/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
*
**************************************************************/

const host = 'https://zenodeo.org';

module.exports = {

loglevel: 'ERROR',
root: 'https://zenodeo.org',

v1: {
uri: {
Expand Down
1 change: 1 addition & 0 deletions config/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
module.exports = {

loglevel: 'ERROR',
root: 'http://z2.punkish.org',

v1: {
uri: {
Expand Down

0 comments on commit 4a4675a

Please sign in to comment.