This commit is contained in:
dimitar 2025-03-31 06:43:31 +02:00
parent f6c0e89290
commit 8d1eb8dea5
3 changed files with 26 additions and 22 deletions

View File

@ -18,6 +18,7 @@ async function bootstrap() {
"https://www.placebo.mk",
"https://placebo.mk",
"http://localhost:5173",
'https://imkapi.oblak.solutions',
],
methods: "GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS",
credentials: true,
@ -27,6 +28,7 @@ async function bootstrap() {
"Content-Type",
"Accept",
"Authorization",
'Access-Control-Allow-Headers',
"Access-Control-Allow-Origin",
"Access-Control-Allow-Credentials",
],

View File

@ -30,6 +30,8 @@ services:
- SMTP_USER=${SMTP_USER}
- SMTP_PASS=${SMTP_PASS}
- EMAIL_FROM=${EMAIL_FROM}
- CORS_ORIGINS=http://localhost:5173,https://www.placebo.mk,https://placebo.mk
- CORS_CREDENTIALS=true
depends_on:
postgres:
condition: service_healthy

View File

@ -1,32 +1,32 @@
// vite.config.js
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
// server: {
// port: 5173,
// proxy: {
// "/api": {
// target: "http://localhost:3000",
// changeOrigin: true,
// secure: false,
// },
// },
// },
build: {
outDir: "dist",
sourcemap: false,
rollupOptions: {
output: {
manualChunks: {
vendor: ["react", "react-dom", "react-router-dom"],
ui: ["@headlessui/react", "@heroicons/react"],
server: {
proxy: {
"/api": {
target: "https://imkapi.oblak.solutions",
changeOrigin: true,
secure: false,
ws: true,
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,
);
});
},
},
},
},
define: {
"process.env.API_URL": JSON.stringify("https://imkapi.oblak.solutions"),
},
});