Skip to content

Commit

Permalink
fix baseUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
devserkan committed Sep 17, 2024
1 parent 19a0be4 commit 6423a04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/services/anecdotes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from 'axios';

const baseUrl = 'http://localhost:3000/api/anecdotes';
const baseUrl = '/api/anecdotes';

export async function getAll() {
const response = await axios.get(baseUrl);
Expand Down
8 changes: 8 additions & 0 deletions frontend/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
proxy: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
},
},
},
test: {
environment: 'jsdom',
globals: true,
Expand Down

0 comments on commit 6423a04

Please sign in to comment.