Skip to content

Commit

Permalink
add proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
cgsv authored and cgsv committed Mar 5, 2023
1 parent ed9b847 commit cc1361d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 27 deletions.
27 changes: 0 additions & 27 deletions pages/api/proxy.js

This file was deleted.

13 changes: 13 additions & 0 deletions pages/api/proxy/[...slug].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { createProxyMiddleware } from "http-proxy-middleware";

export const config = {
api: {
bodyParser: false,
},
}

export default createProxyMiddleware({
target: "https://api.openai.com",
changeOrigin: true,
pathRewrite: {[`^/api/proxy`]: ''},
});

1 comment on commit cc1361d

@vercel
Copy link

@vercel vercel bot commented on cc1361d Mar 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextjs – ./

nextjs-git-main-cgsvv.vercel.app
nextjs-cgsvv.vercel.app
nextjs-bay-one-40.vercel.app
next.cgsv.top

Please sign in to comment.