Fix port configuration for Hugging Face Spaces
Browse filesUse port 7860 in production environment to match HF Spaces expectations.
Local development still uses port 5000.
- server/index.ts +1 -1
server/index.ts
CHANGED
@@ -174,7 +174,7 @@ app.use((req, res, next) => {
|
|
174 |
|
175 |
// Serve the app on the configured port (5000 for local, 7860 for HF Spaces)
|
176 |
// this serves both the API and the client.
|
177 |
-
const port = process.env.PORT ? parseInt(process.env.PORT) : 5000;
|
178 |
server.listen({
|
179 |
port,
|
180 |
host: "0.0.0.0",
|
|
|
174 |
|
175 |
// Serve the app on the configured port (5000 for local, 7860 for HF Spaces)
|
176 |
// this serves both the API and the client.
|
177 |
+
const port = process.env.PORT ? parseInt(process.env.PORT) : (process.env.NODE_ENV === 'production' ? 7860 : 5000);
|
178 |
server.listen({
|
179 |
port,
|
180 |
host: "0.0.0.0",
|