mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 20:29:09 +00:00
* fix(banking): correct usage of hooks in rule action * fix(banking): apply ESLint rules for hooks * fix(banking): add lazy imports and code-splitting
18 lines
534 B
TypeScript
18 lines
534 B
TypeScript
import { readFileSync } from 'node:fs';
|
|
|
|
const common_site_config = JSON.parse(
|
|
readFileSync(new URL('../../../sites/common_site_config.json', import.meta.url), 'utf8')
|
|
) as { webserver_port: string | number };
|
|
const { webserver_port } = common_site_config;
|
|
|
|
export default {
|
|
'^/(app|api|assets|files|private)': {
|
|
target: `http://127.0.0.1:${webserver_port}`,
|
|
ws: true,
|
|
router: function (req) {
|
|
const site_name = req.headers?.host?.split(':')[0];
|
|
return `http://${site_name ?? 'localhost'}:${webserver_port}`;
|
|
}
|
|
}
|
|
};
|