mirror of
https://github.com/danielvici/tool-website.git
synced 2026-01-16 19:41:26 +00:00
Initial commit: Tool Website with Password Generator, Image Converter and Bookmarks
This commit is contained in:
28
start.js
Normal file
28
start.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const { exec } = require('child_process');
|
||||
const os = require('os');
|
||||
|
||||
// Starte den Entwicklungsserver
|
||||
exec('npm run dev', (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
console.error(`Fehler beim Starten des Servers: ${error}`);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
// Warte kurz und öffne dann den Browser
|
||||
setTimeout(() => {
|
||||
const platform = os.platform();
|
||||
const url = 'http://localhost:3000';
|
||||
|
||||
switch (platform) {
|
||||
case 'win32':
|
||||
exec(`start ${url}`);
|
||||
break;
|
||||
case 'darwin':
|
||||
exec(`open ${url}`);
|
||||
break;
|
||||
default:
|
||||
exec(`xdg-open ${url}`);
|
||||
break;
|
||||
}
|
||||
}, 3000); // Warte 3 Sekunden, bis der Server gestartet ist
|
||||
Reference in New Issue
Block a user