From 08df5903a06d0794f7533a03be4043e4d6edd727 Mon Sep 17 00:00:00 2001 From: Willian Galvani Date: Wed, 17 Jan 2024 16:18:41 -0300 Subject: [PATCH] core: frontend: warn developers if they use a bad BLUEOS_ADDRESS environment variable --- core/frontend/vite.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/frontend/vite.config.js b/core/frontend/vite.config.js index f9a5dbaf03..cf920a113f 100644 --- a/core/frontend/vite.config.js +++ b/core/frontend/vite.config.js @@ -7,10 +7,14 @@ const { name } = require('./package.json') process.env.PROJECT_NAME = name process.env.VITE_BUILD_DATE = new Date().toLocaleString() -const DEFAULT_ADDRESS = 'http://blueos-avahi.local/' +const DEFAULT_ADDRESS = 'http://blueos.local/' const SERVER_ADDRESS = process.env.BLUEOS_ADDRESS ?? DEFAULT_ADDRESS const path = require('path') +const assert = require('assert'); + +// TODO: check if it works with https once we have something that does +assert.ok(SERVER_ADDRESS.startsWith('http://'), 'SERVER_ADDRESS must start with http://'); export default defineConfig({ plugins: [