Procházet zdrojové kódy

Optionally set the port number of the dev server using an environment variable

customisations
alemart před 1 měsícem
rodič
revize
0557ebe9c2
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1
    1
      esbuild.mjs

+ 1
- 1
esbuild.mjs Zobrazit soubor

@@ -42,7 +42,7 @@ const ctx = await esbuild.context(options);
42 42
 await ctx.watch();
43 43
 await ctx.serve({
44 44
     host: '0.0.0.0',
45
-    port: 8000,
45
+    port: Number(process.env.PORT ?? 8000),
46 46
     servedir: 'www',
47 47
     keyfile: new URL('.local-server.key', import.meta.url).pathname,
48 48
     certfile: new URL('.local-server.cert', import.meta.url).pathname,

Načítá se…
Zrušit
Uložit