-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebtask.js
More file actions
20 lines (15 loc) · 662 Bytes
/
webtask.js
File metadata and controls
20 lines (15 loc) · 662 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const tools = require('auth0-extension-express-tools');
const expressApp = require('./server');
const config = require('./server/lib/config');
const logger = require('./server/lib/logger');
const createServer = tools.createServer((cfg, storage) => {
logger.info('Starting Auth0 Authentication API Debugger - Version:', process.env.CLIENT_VERSION);
return expressApp(cfg, storage);
});
module.exports = (context, req, res) => {
const publicUrl = (req.x_wt && req.x_wt.ectx && req.x_wt.ectx.PUBLIC_WT_URL) || false;
if (!publicUrl) {
config.setValue('PUBLIC_WT_URL', tools.urlHelpers.getWebtaskUrl(req));
}
createServer(context, req, res);
};