Skip to content

Commit

Permalink
add Access-Control-Allow-Origin header
Browse files Browse the repository at this point in the history
  • Loading branch information
Ice-Hazymoon committed Mar 6, 2023
1 parent 4965889 commit 0f06d69
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ const port = 9000
app.use('/', createProxyMiddleware({
target: 'https://api.openai.com',
changeOrigin: true,
onProxyRes: function (proxyRes, req, res) {
proxyRes.headers['Access-Control-Allow-Origin'] = '*';
}
}));

app.listen(port, () => {
Expand Down

0 comments on commit 0f06d69

Please sign in to comment.