allow port variable to be set for dev server

This commit is contained in:
Percs 2024-06-17 20:11:02 -05:00
parent 1d9870e706
commit 409275fa49
3 changed files with 6 additions and 1 deletions

View file

@ -1,6 +1,7 @@
import { createServer } from "esbuild-server";
import copy from "esbuild-plugin-copy";
import time from "esbuild-plugin-time";
import "dotenv/config"
const devServer = createServer({
entryPoints: {
@ -45,7 +46,7 @@ const devServer = createServer({
]
}, {
static: "./static",
port: 1337,
port: process.env.PORT || 1337,
proxy: (path) => {
if (path.startsWith("/bare/")) {
return path.replace("/bare/", "http://127.0.0.1:3000/")