MukeshKapoor25 commited on
Commit
19994df
·
verified ·
1 Parent(s): 52f6c9e

Update app.js

Browse files
Files changed (1) hide show
  1. app.js +9 -21
app.js CHANGED
@@ -1,23 +1,11 @@
1
- # Use Node.js LTS version as the base image
2
- FROM node:18
 
3
 
4
- # Set the working directory inside the container
5
- WORKDIR /app
 
6
 
7
- # Copy package.json and package-lock.json into the container
8
- COPY package*.json ./
9
-
10
- # Install dependencies
11
- RUN npm install
12
-
13
- # Copy the application code into the container
14
- COPY . .
15
-
16
- # Expose the default port used by Hugging Face Spaces (7860)
17
- EXPOSE 7860
18
-
19
- # Set environment variable for Hugging Face
20
- ENV PORT=7860
21
-
22
- # Define the command to run the application
23
- CMD ["npm", "start"]
 
1
+ const express = require('express');
2
+ const app = express();
3
+ const port = process.env.PORT || 3000;
4
 
5
+ app.get('/', (req, res) => {
6
+ res.send('Hello, Node.js app running in Docker!');
7
+ });
8
 
9
+ app.listen(port, () => {
10
+ console.log(`App is running on http://localhost:${port}`);
11
+ });