Last active
August 21, 2020 13:53
-
-
Save pkrisko/ceaca134fd9f6efdfb696a8c97a3e91f to your computer and use it in GitHub Desktop.
Proxy all /api traffic from your next.js backend to whatever you want.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createProxyMiddleware } from 'http-proxy-middleware'; | |
export default createProxyMiddleware({ | |
target: process.env.FIREBASE_API_DOMAIN, | |
changeOrigin: true, | |
pathRewrite: { | |
'^/api': '/', | |
}, | |
prependPath: true, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment