From 33e6925dabcea8055f71be7b1eb7a8f202fe5e4f Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Mon, 6 Feb 2023 18:31:34 +0100 Subject: [PATCH] Cleaning here and there --- README.md | 19 +++++++++++-------- web/admin-gui/vite.config.ts | 6 +++--- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3d22f18..30720c6 100644 --- a/README.md +++ b/README.md @@ -22,14 +22,17 @@ TODO ### Environment variables -- ./env - - APP_API_ADDRESS: `http://example.com` - - APP_FRONT_ADDRESS: `http://example.com` - - APP_BASE_API_PATH: `/example` - - APP_BASE_FRONT_PATH: `/example` - - APP_API_PORT: `1234` - - APP_FRONT_PORT: `1234` - - APP_JWT_SECRET: `secret` +- ./env: + +``` +APP_API_ADDRESS=http://example.com +APP_FRONT_ADDRESS=http://example.com +APP_BASE_API_PATH=/example +APP_BASE_FRONT_PATH=/example +APP_API_PORT=1234 +APP_FRONT_PORT=1234 +APP_JWT_SECRET=secret +``` ## API Usage diff --git a/web/admin-gui/vite.config.ts b/web/admin-gui/vite.config.ts index 842f6a3..bc86a23 100644 --- a/web/admin-gui/vite.config.ts +++ b/web/admin-gui/vite.config.ts @@ -1,9 +1,9 @@ import { fileURLToPath, URL } from "node:url" -import { defineConfig, loadEnv } from "vite" +import { defineConfig, loadEnv, type UserConfig } from "vite" import vue from "@vitejs/plugin-vue" // https://vitejs.dev/config/ -export default defineConfig(({ command, mode }) => { +export default defineConfig(({ command, mode }): UserConfig => { const env1 = loadEnv(mode, "./../../", "") const env2 = loadEnv(mode, process.cwd(), "") @@ -21,7 +21,7 @@ export default defineConfig(({ command, mode }) => { } }, server: { - port: env1.APP_FRONT_PORT, + port: parseInt(env1.APP_FRONT_PORT), }, base: env1.APP_BASE_FRONT_PATH ?? "/" }