url sp_adress + wsurl + server config

This commit is contained in:
Omar Oughriss 2024-10-10 16:04:19 +02:00
parent d07f9ce7c3
commit fe672fce1d
3 changed files with 10 additions and 2 deletions

View File

@ -1,7 +1,8 @@
import Services from './services/service';
// import { WebSocketClient } from './websockets';
const wsurl = `ws://74.234.68.175:8091`;
// const wsurl = `ws://74.234.68.175:8091`;
const wsurl = `wss://localhost/ws/`;
document.addEventListener('DOMContentLoaded', async () => {
try {

View File

@ -76,7 +76,8 @@ export default class Services {
console.log("🚀 ~ Services ~ generateQRCode= ~ text:", text)
try {
const container = document.getElementById('containerId');
const url = await QRCode.toDataURL(text);
const currentUrl = window.location.href;
const url = await QRCode.toDataURL(currentUrl + "?sp_address=" + text);
const qrCode = container?.querySelector('.qr-code img');
qrCode?.setAttribute('src', url)
} catch (err) {

View File

@ -34,7 +34,13 @@ export default defineConfig({
extensions: ['.ts', '.tsx', '.js'],
},
server: {
host: 'localhost',
open: false,
port: 3001,
strictPort: true, // Empêche de changer de port si le 3001 est occupé
hmr: {
port: 9050, // Assure que le WebSocket HMR utilise bien le même port
protocol: 'wss',
}
},
});