forked from jchomaz/Vulture
gestion d'une config pour les ip si prod ou dev
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head> <meta charset="UTF-8"> <link rel="icon" href="/favicon.ico"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Brain Blast</title>
|
||||
<script src="/config.js"></script>
|
||||
</head>
|
||||
<body> <div id="app"></div> <script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
|
||||
7
VApp/public/config.js
Normal file
7
VApp/public/config.js
Normal file
@@ -0,0 +1,7 @@
|
||||
window.APP_CONFIG = {
|
||||
mqttBrokerUrl: 'ws://192.168.73.252:9001',
|
||||
redBuzzerIP: '192.168.73.40',
|
||||
blueBuzzerIP: '192.168.73.41',
|
||||
orangeBuzzerIP: '192.168.73.42',
|
||||
greenBuzzerIP: '192.168.73.43'
|
||||
};
|
||||
@@ -1,16 +1,15 @@
|
||||
// Fichier vide, regarde config.js.example pour personaliser ce fichier.
|
||||
// Note de dev : Normalement ce fichier ne devrait plus avoir de
|
||||
// modifications
|
||||
|
||||
// config.js
|
||||
export default {
|
||||
mqttBrokerUrl: 'ws://192.168.73.252:9001',
|
||||
// Reads configuration from window.APP_CONFIG (loaded via public/config.js)
|
||||
// This allows runtime configuration changes without rebuilding the app.
|
||||
|
||||
// Buzzer
|
||||
const defaults = {
|
||||
mqttBrokerUrl: 'ws://192.168.73.252:9001',
|
||||
redBuzzerIP: '192.168.73.40',
|
||||
blueBuzzerIP: '192.168.73.41',
|
||||
orangeBuzzerIP: '192.168.73.42',
|
||||
greenBuzzerIP: '192.168.73.43'
|
||||
|
||||
// Light
|
||||
};
|
||||
|
||||
const config = window.APP_CONFIG || defaults;
|
||||
|
||||
export default config;
|
||||
|
||||
Reference in New Issue
Block a user