Spaces:
Runtime error
Runtime error
Update app.js
Browse files
app.js
CHANGED
|
@@ -1,23 +1,11 @@
|
|
| 1 |
-
|
| 2 |
-
|
|
|
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
|
|
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 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 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|