Page MenuHomeDevCentral

D2189.id5504.diff
No OneTemporary

D2189.id5504.diff

diff --git a/bin/www b/bin/www
--- a/bin/www
+++ b/bin/www
@@ -8,11 +8,14 @@
const http = require('http');
/**
- * Get port from environment and store in Express.
+ * Get information from environment and store in Express.
*/
const port = normalizePort(process.env.PORT || '80');
app.set('port', port);
+const api_entry_point = process.env.API_ENTRY_POINT || '/datasources';
+app.set('api_entry_point', api_entry_point);
+
/**
* Create HTTP server.
*/
diff --git a/routes.js b/routes.js
--- a/routes.js
+++ b/routes.js
@@ -49,19 +49,21 @@
url += ":" + port;
}
+ url += app.get("api_entry_point");
+
url += req.url;
return url;
}
-router.get('/', function(req, res) {
+router.get('', function(req, res) {
let url = getUrl(req);
res.send(JSON.stringify(formatDatasources(url)));
});
datasources.forEach(function (datasource) {
- router.get('/' + datasource.url, function (req, res) {
+ router.get(datasource.url, function (req, res) {
require("./controllers/" + datasource.controller)
.get(req, res);
});

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 15:45 (21 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2252654
Default Alt Text
D2189.id5504.diff (1 KB)

Event Timeline