Skip to content

Commit cfe8cb5

Browse files
author
Rafal Galka
committed
enable CORS
1 parent 2cb4668 commit cfe8cb5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/proxy.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ function createRouter(target) {
105105

106106
router = httpProxy.createProxyServer(options);
107107

108+
router.on('proxyRes', function (proxyRes, req, res) {
109+
res.setHeader('Access-Control-Allow-Origin', '*');
110+
});
111+
108112
routers[key] = router;
109113
}
110114

0 commit comments

Comments
 (0)