Basti1110 commited on
Commit
5ee8e90
·
verified ·
1 Parent(s): 85e39f5

added port listener

Browse files
Files changed (1) hide show
  1. app.js +10 -0
app.js CHANGED
@@ -7,6 +7,16 @@ dotenv.config();
7
  const app = express();
8
  const port = process.env.PORT; // Hugging Face will set this dynamically
9
 
 
 
 
 
 
 
 
 
 
 
10
 
11
  app.use(bodyParser.urlencoded({ extended: true }));
12
  app.use(express.static('public'));
 
7
  const app = express();
8
  const port = process.env.PORT; // Hugging Face will set this dynamically
9
 
10
+ if (!port) {
11
+ console.error("❌ PORT not defined");
12
+ process.exit(1);
13
+ }
14
+
15
+ app.listen(port, () => {
16
+ console.log(`✅ Server listening on port ${port}`);
17
+ });
18
+
19
+
20
 
21
  app.use(bodyParser.urlencoded({ extended: true }));
22
  app.use(express.static('public'));