test
This commit is contained in:
parent
5fb1d2ddbd
commit
69da08d133
@ -83,7 +83,7 @@ WSGI_APPLICATION = 'core.wsgi.application'
|
|||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': dj_database_url.config(
|
'default': dj_database_url.config(
|
||||||
default=f"mysql://{config('DB_USER', default='user')}:{config('DB_PASSWORD', default='password')}@{config('DB_HOST', default='host')}:{config('DB_PORT', default='3306')}/{config('DB_NAME', default='name')}"
|
default=f"mysql://{config('MYSQL_USER', default='user')}:{config('MYSQL_PASSWORD', default='password')}@{config('MYSQL_HOST', default='host')}:{config('MYSQL_PORT', default='3306')}/{config('MYSQL_DATABASE', default='name')}"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,8 +125,8 @@ STATIC_URL = 'static/'
|
|||||||
|
|
||||||
# CORS configuration
|
# CORS configuration
|
||||||
CORS_ALLOWED_ORIGINS = [
|
CORS_ALLOWED_ORIGINS = [
|
||||||
"http://localhost:5173",
|
"http://localhost:1028",
|
||||||
"http://127.0.0.1:5173",
|
"http://127.0.0.1:1028"
|
||||||
]
|
]
|
||||||
|
|
||||||
# REST Framework & JWT settings
|
# REST Framework & JWT settings
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import axios from 'axios';
|
|||||||
|
|
||||||
// Utiliser l'URL correcte pour le backend
|
// Utiliser l'URL correcte pour le backend
|
||||||
const api = axios.create({
|
const api = axios.create({
|
||||||
baseURL: '/api',
|
baseURL: import.meta.env.PROD ? '/api' : 'http://localhost:1029/api',
|
||||||
});
|
});
|
||||||
|
|
||||||
// Ajouter un intercepteur pour gérer les erreurs de réseau
|
// Ajouter un intercepteur pour gérer les erreurs de réseau
|
||||||
|
|||||||
@ -4,6 +4,17 @@ import react from '@vitejs/plugin-react'
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'http://localhost:1029',
|
||||||
|
changeOrigin: true,
|
||||||
|
secure: false,
|
||||||
|
rewrite: (path) => path.replace(/^\/api/, '/api')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
preview: {
|
preview: {
|
||||||
allowedHosts: [
|
allowedHosts: [
|
||||||
'boulangerie.louismazin.ovh'
|
'boulangerie.louismazin.ovh'
|
||||||
|
|||||||
4
start.sh
4
start.sh
@ -54,15 +54,13 @@ if [ ! -x "node_modules/.bin/vite" ]; then
|
|||||||
npm ci
|
npm ci
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export VITE_API_URL="/api"
|
|
||||||
|
|
||||||
echo "Build React..."
|
echo "Build React..."
|
||||||
|
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
echo "Démarrage frontend sur :1028"
|
echo "Démarrage frontend sur :1028"
|
||||||
|
|
||||||
npm run preview -- --host 0.0.0.0 --port 1028 &
|
npm run preview --host 0.0.0.0 --port 1028 &
|
||||||
FRONTEND_PID=$!
|
FRONTEND_PID=$!
|
||||||
|
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user