CORS set up
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
const API_URL = 'http://localhost:3002/api';
|
const API_URL = '/api';
|
||||||
|
|
||||||
export const getAuthToken = () => localStorage.getItem('token');
|
export const getAuthToken = () => localStorage.getItem('token');
|
||||||
export const setAuthToken = (token: string) => localStorage.setItem('token', token);
|
export const setAuthToken = (token: string) => localStorage.setItem('token', token);
|
||||||
|
|||||||
@@ -8,6 +8,13 @@ export default defineConfig(({ mode }) => {
|
|||||||
server: {
|
server: {
|
||||||
port: 3000,
|
port: 3000,
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'http://127.0.0.1:3002',
|
||||||
|
changeOrigin: true,
|
||||||
|
secure: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
define: {
|
define: {
|
||||||
|
|||||||
Reference in New Issue
Block a user