cors again
This commit is contained in:
parent
42a1af1117
commit
8742ea5714
@ -22,5 +22,6 @@ export const corsConfig = {
|
|||||||
"Authorization",
|
"Authorization",
|
||||||
"posthog-session-id",
|
"posthog-session-id",
|
||||||
"ph-session-id",
|
"ph-session-id",
|
||||||
|
"Access-Control-Allow-Origin",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
export const config = {
|
export const config = {
|
||||||
apiUrl: "https://imkapi.oblak.solutions",
|
apiUrl: "https://imkapi.oblak.solutions",
|
||||||
REACT_APP_PUBLIC_POSTHOG_KEY:
|
// REACT_APP_PUBLIC_POSTHOG_KEY:
|
||||||
"phc_dLQV3ZMDaqyRw0j71BcLwuKCq9CkmKxpKxj3pJwgX7x",
|
// "phc_dLQV3ZMDaqyRw0j71BcLwuKCq9CkmKxpKxj3pJwgX7x",
|
||||||
REACT_APP_PUBLIC_POSTHOG_HOST: "https://eu.i.posthog.com",
|
// REACT_APP_PUBLIC_POSTHOG_HOST: "https://eu.i.posthog.com",
|
||||||
};
|
};
|
||||||
|
|||||||
@ -4,14 +4,28 @@ import react from "@vitejs/plugin-react";
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
server: {
|
server: {
|
||||||
port: 5173,
|
proxy: {
|
||||||
// cors: {
|
"/api": {
|
||||||
// origin: [
|
target: "https://imkapi.oblak.solutions",
|
||||||
// "https://eu-assets.i.posthog.com",
|
changeOrigin: true,
|
||||||
// "https://app.posthog.com",
|
secure: true,
|
||||||
// "https://eu.posthog.com",
|
rewrite: (path) => path.replace(/^\/api/, ""),
|
||||||
// ],
|
configure: (proxy, _options) => {
|
||||||
// allowedHeaders: ["posthog-session-id", "ph-session-id"],
|
proxy.on("error", (err, _req, _res) => {
|
||||||
// },
|
console.log("proxy error", err);
|
||||||
|
});
|
||||||
|
proxy.on("proxyReq", (proxyReq, req, _res) => {
|
||||||
|
console.log("Sending Request to the Target:", req.method, req.url);
|
||||||
|
});
|
||||||
|
proxy.on("proxyRes", (proxyRes, req, _res) => {
|
||||||
|
console.log(
|
||||||
|
"Received Response from the Target:",
|
||||||
|
proxyRes.statusCode,
|
||||||
|
req.url,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user