fix: use relative /api URL to prevent mixed content errors on HTTPS
parent
fef33cc9be
commit
34daa301ed
|
|
@ -1,6 +1,6 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_BASE || 'http://localhost:8001/api';
|
const API_BASE = import.meta.env.VITE_API_BASE || '/api';
|
||||||
|
|
||||||
const api = axios.create({ baseURL: API_BASE, withCredentials: true });
|
const api = axios.create({ baseURL: API_BASE, withCredentials: true });
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import type { UserResponse } from '../store/useAuthStore';
|
import type { UserResponse } from '../store/useAuthStore';
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_BASE || 'http://localhost:8001/api';
|
const API_BASE = import.meta.env.VITE_API_BASE || '/api';
|
||||||
|
|
||||||
const api = axios.create({ baseURL: API_BASE, withCredentials: true });
|
const api = axios.create({ baseURL: API_BASE, withCredentials: true });
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_BASE || 'http://localhost:8001/api';
|
const API_BASE = import.meta.env.VITE_API_BASE || '/api';
|
||||||
|
|
||||||
export interface SketchFile {
|
export interface SketchFile {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
const API_BASE = `${import.meta.env.VITE_API_BASE || 'http://localhost:8001/api'}/libraries`;
|
const API_BASE = `${import.meta.env.VITE_API_BASE || '/api'}/libraries`;
|
||||||
|
|
||||||
export interface ArduinoLibrary {
|
export interface ArduinoLibrary {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_BASE || 'http://localhost:8001/api';
|
const API_BASE = import.meta.env.VITE_API_BASE || '/api';
|
||||||
|
|
||||||
const api = axios.create({ baseURL: API_BASE, withCredentials: true });
|
const api = axios.create({ baseURL: API_BASE, withCredentials: true });
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,14 @@ export default defineConfig({
|
||||||
'@wokwi/elements': path.resolve(__dirname, '../wokwi-libs/wokwi-elements/dist/esm'),
|
'@wokwi/elements': path.resolve(__dirname, '../wokwi-libs/wokwi-elements/dist/esm'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'http://localhost:8001',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
include: ['avr8js', 'rp2040js', '@wokwi/elements'],
|
include: ['avr8js', 'rp2040js', '@wokwi/elements'],
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue