Fix jwt-token
This commit is contained in:
2
client/.env.development
Normal file
2
client/.env.development
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Development environment - runs on root path
|
||||||
|
VITE_BASE_PATH=
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
# Client Environment Configuration
|
# Client Environment Configuration
|
||||||
|
|
||||||
# Base path for the application (used for deployment in subdirectories)
|
# Base path for the application (used for deployment in subdirectories)
|
||||||
# Default: '/drones' in production, '' in development
|
# Examples:
|
||||||
# Example: VITE_BASE_PATH=/my-custom-path
|
# For root deployment: VITE_BASE_PATH=/
|
||||||
# VITE_BASE_PATH=
|
# For subdirectory deployment: VITE_BASE_PATH=/uggla/
|
||||||
|
# Leave empty for default (root): VITE_BASE_PATH=
|
||||||
|
VITE_BASE_PATH=/uggla/
|
||||||
|
|
||||||
# API URL override (if API is hosted on different domain/port)
|
# API URL override (if API is hosted on different domain/port)
|
||||||
# Default: auto-detected based on environment
|
# Default: auto-detected based on environment
|
||||||
|
|||||||
2
client/.env.production
Normal file
2
client/.env.production
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Production environment - deployed under /uggla/ path
|
||||||
|
VITE_BASE_PATH=/uggla/
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
// Application configuration
|
// Application configuration from environment variables
|
||||||
export const APP_CONFIG = {
|
export const APP_CONFIG = {
|
||||||
// Base path for the application in production
|
// Base path for the application (set via VITE_BASE_PATH)
|
||||||
// Can be overridden with VITE_BASE_PATH environment variable
|
basePath: import.meta.env.VITE_BASE_PATH || '',
|
||||||
basePath: import.meta.env.VITE_BASE_PATH || (import.meta.env.PROD ? '/drones' : ''),
|
|
||||||
|
|
||||||
// API configuration
|
// API configuration
|
||||||
api: {
|
api: {
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import react from '@vitejs/plugin-react'
|
import react from '@vitejs/plugin-react'
|
||||||
|
|
||||||
// Application base path configuration
|
// Application base path configuration from environment variables
|
||||||
// Can be overridden with VITE_BASE_PATH environment variable
|
// Set VITE_BASE_PATH in .env files to configure the deployment path
|
||||||
// This should match the base path used in nginx/reverse proxy configuration
|
const BASE_PATH = process.env.VITE_BASE_PATH || '/'
|
||||||
const BASE_PATH = process.env.VITE_BASE_PATH || (process.env.NODE_ENV === 'production' ? '/drones/' : '/')
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
|||||||
Reference in New Issue
Block a user