Retrieve data through proxy [...path]
This commit is contained in:
11
pages/api/[...path].js
Normal file
11
pages/api/[...path].js
Normal file
@@ -0,0 +1,11 @@
|
||||
// pages/api/[...path].js
|
||||
import { createProxyMiddleware } from "http-proxy-middleware";
|
||||
|
||||
export default createProxyMiddleware({
|
||||
target: "http://10.10.0.13", // Ziel-URL des Proxys
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
"^/api": "/", // Optional: Entfernt /api aus dem Pfad, wenn das Backend dies nicht erfordert
|
||||
},
|
||||
logLevel: "debug", // Setzt das Logging-Level auf "debug" für detaillierte Ausgaben
|
||||
});
|
||||
Reference in New Issue
Block a user