Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
tanish35 committed Oct 10, 2024
1 parent 6139d9f commit 85dab14
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 0 additions & 3 deletions frontend/src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.jsx";
import axios from "axios";

axios.defaults.baseURL = import.meta.env.VITE_BACKEND_URL;

ReactDOM.createRoot(document.getElementById("root")).render(<App />);
11 changes: 11 additions & 0 deletions frontend/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "tailwindcss";
import dotenv from "dotenv";
dotenv.config();

export default defineConfig({
plugins: [react()],
Expand All @@ -9,4 +11,13 @@ export default defineConfig({
plugins: [tailwindcss()],
},
},
server: {
proxy: {
"/api": {
target: process.env.VITE_BACKEND_URL,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ""), // Optional: remove '/api' from the path
},
},
},
});

0 comments on commit 85dab14

Please sign in to comment.