refactor: simplify HTTPS configuration in Vite setup
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m41s

This commit is contained in:
2026-04-21 13:42:42 -04:00
parent 8da61ce335
commit cdfaf7ead1

View File

@@ -7,14 +7,16 @@ export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '') const env = loadEnv(mode, process.cwd(), '')
const backendHost = env.VITE_BACKEND_HOST ?? '127.0.0.1' const backendHost = env.VITE_BACKEND_HOST ?? '127.0.0.1'
const httpsConfig =
fs.existsSync('./key.pem') && fs.existsSync('./cert.pem')
? { key: fs.readFileSync('./key.pem'), cert: fs.readFileSync('./cert.pem') }
: undefined
return { return {
plugins: [vue()], plugins: [vue()],
server: { server: {
host: '0.0.0.0', host: '0.0.0.0',
https: { https: httpsConfig,
key: fs.readFileSync('./key.pem'),
cert: fs.readFileSync('./cert.pem'),
},
proxy: { proxy: {
'/api': { '/api': {
target: `http://${backendHost}:5000`, target: `http://${backendHost}:5000`,