-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathproxy.conf.js
More file actions
28 lines (24 loc) · 841 Bytes
/
proxy.conf.js
File metadata and controls
28 lines (24 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* Dev server proxy — auto-generated from src/env.js
*
* env.js is the single source of truth. Change API_LOCATION there;
* the dev server picks it up on next restart. No need to touch this file.
*/
const fs = require('fs');
const vm = require('vm');
const path = require('path');
const envJs = fs.readFileSync(path.join(__dirname, 'src', 'env.js'), 'utf-8');
const sandbox = { __env: {} };
vm.runInNewContext(envJs, sandbox);
const target = sandbox.__env.API_LOCATION || 'http://localhost:3000';
const proxyRule = { target, secure: false, changeOrigin: true };
module.exports = {
'/api': proxyRule,
'/analytics': proxyRule,
'/engage-api': {
target: 'https://epic-engage-web-test.apps.gold.devops.gov.bc.ca',
pathRewrite: { '^/engage-api': '/api' },
secure: false,
changeOrigin: true,
},
};