Support Port from .env
This commit is contained in:
@@ -33,6 +33,7 @@ let server;
|
|||||||
|
|
||||||
if (isProd) {
|
if (isProd) {
|
||||||
server = serve({
|
server = serve({
|
||||||
|
port: process.env.PORT ? Number(process.env.PORT) : 3000,
|
||||||
routes: {
|
routes: {
|
||||||
...apiRoutes,
|
...apiRoutes,
|
||||||
"/*": async req => {
|
"/*": async req => {
|
||||||
@@ -47,6 +48,7 @@ if (isProd) {
|
|||||||
} else {
|
} else {
|
||||||
const index = (await import("./index.html")).default;
|
const index = (await import("./index.html")).default;
|
||||||
server = serve({
|
server = serve({
|
||||||
|
port: process.env.PORT ? Number(process.env.PORT) : 3000,
|
||||||
routes: {
|
routes: {
|
||||||
"/*": index,
|
"/*": index,
|
||||||
...apiRoutes,
|
...apiRoutes,
|
||||||
|
|||||||
Reference in New Issue
Block a user