mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-04 04:59:40 +00:00
47 lines
1 KiB
JavaScript
47 lines
1 KiB
JavaScript
|
|
// TODO abstract from server
|
||
|
|
const path = require('path');
|
||
|
|
const nconf = require('nconf');
|
||
|
|
const setupNconf = require('../../website/server/libs/setupNconf');
|
||
|
|
|
||
|
|
let configFile = path.join(path.resolve(__dirname, '../../config.json'));
|
||
|
|
|
||
|
|
setupNconf(configFile);
|
||
|
|
|
||
|
|
const DEV_BASE_URL = nconf.get('BASE_URL');
|
||
|
|
|
||
|
|
module.exports = {
|
||
|
|
devServer: {
|
||
|
|
proxy: {
|
||
|
|
// proxy all requests to the server at IP:PORT as specified in the top-level config
|
||
|
|
'^/api/v3': {
|
||
|
|
target: DEV_BASE_URL,
|
||
|
|
changeOrigin: true,
|
||
|
|
},
|
||
|
|
'^/api/v4': {
|
||
|
|
target: DEV_BASE_URL,
|
||
|
|
changeOrigin: true,
|
||
|
|
},
|
||
|
|
'^/stripe': {
|
||
|
|
target: DEV_BASE_URL,
|
||
|
|
changeOrigin: true,
|
||
|
|
},
|
||
|
|
'^/amazon': {
|
||
|
|
target: DEV_BASE_URL,
|
||
|
|
changeOrigin: true,
|
||
|
|
},
|
||
|
|
'^/paypal': {
|
||
|
|
target: DEV_BASE_URL,
|
||
|
|
changeOrigin: true,
|
||
|
|
},
|
||
|
|
'^/logout-server': {
|
||
|
|
target: DEV_BASE_URL,
|
||
|
|
changeOrigin: true,
|
||
|
|
},
|
||
|
|
'^/export': {
|
||
|
|
target: DEV_BASE_URL,
|
||
|
|
changeOrigin: true,
|
||
|
|
},
|
||
|
|
}
|
||
|
|
}
|
||
|
|
};
|