Spaces:
Paused
Paused
Force PORT to 7860 on Hugging Face Spaces
Browse files- src/index.js +2 -1
src/index.js
CHANGED
|
@@ -86,7 +86,8 @@ app.use((err, req, res, next) => {
|
|
| 86 |
const http = require('http');
|
| 87 |
const wsManager = require('./lib/ws');
|
| 88 |
|
| 89 |
-
|
|
|
|
| 90 |
const server = http.createServer(app);
|
| 91 |
|
| 92 |
// Initialize WebSockets
|
|
|
|
| 86 |
const http = require('http');
|
| 87 |
const wsManager = require('./lib/ws');
|
| 88 |
|
| 89 |
+
// Force 7860 on Hugging Face Spaces (which sets SPACE_ID), otherwise use .env PORT or default to 4000
|
| 90 |
+
const PORT = process.env.SPACE_ID ? 7860 : (process.env.PORT || 4000);
|
| 91 |
const server = http.createServer(app);
|
| 92 |
|
| 93 |
// Initialize WebSockets
|