cors again
This commit is contained in:
parent
42a1af1117
commit
8742ea5714
@ -22,5 +22,6 @@ export const corsConfig = {
|
||||
"Authorization",
|
||||
"posthog-session-id",
|
||||
"ph-session-id",
|
||||
"Access-Control-Allow-Origin",
|
||||
],
|
||||
};
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
export const config = {
|
||||
apiUrl: "https://imkapi.oblak.solutions",
|
||||
REACT_APP_PUBLIC_POSTHOG_KEY:
|
||||
"phc_dLQV3ZMDaqyRw0j71BcLwuKCq9CkmKxpKxj3pJwgX7x",
|
||||
REACT_APP_PUBLIC_POSTHOG_HOST: "https://eu.i.posthog.com",
|
||||
// REACT_APP_PUBLIC_POSTHOG_KEY:
|
||||
// "phc_dLQV3ZMDaqyRw0j71BcLwuKCq9CkmKxpKxj3pJwgX7x",
|
||||
// REACT_APP_PUBLIC_POSTHOG_HOST: "https://eu.i.posthog.com",
|
||||
};
|
||||
|
||||
@ -4,14 +4,28 @@ import react from "@vitejs/plugin-react";
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
port: 5173,
|
||||
// cors: {
|
||||
// origin: [
|
||||
// "https://eu-assets.i.posthog.com",
|
||||
// "https://app.posthog.com",
|
||||
// "https://eu.posthog.com",
|
||||
// ],
|
||||
// allowedHeaders: ["posthog-session-id", "ph-session-id"],
|
||||
// },
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: "https://imkapi.oblak.solutions",
|
||||
changeOrigin: true,
|
||||
secure: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ""),
|
||||
configure: (proxy, _options) => {
|
||||
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