Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3755434
D2189.id5504.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D2189.id5504.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D2189: Fix mounting point for nginx proxy
Attached
Detach File
Event Timeline
Log In to Comment