Spaces:
Running
Running
Create index.js
Browse files
index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// index.js
|
| 2 |
+
const express = require("express");
|
| 3 |
+
|
| 4 |
+
const app = express();
|
| 5 |
+
const port = 7860;
|
| 6 |
+
|
| 7 |
+
// Middleware
|
| 8 |
+
app.use(express.json());
|
| 9 |
+
|
| 10 |
+
// Basic route
|
| 11 |
+
app.get("/", (req, res) => {
|
| 12 |
+
res.json({ message: "Hello, world! 🚀" });
|
| 13 |
+
});
|
| 14 |
+
|
| 15 |
+
// Start server
|
| 16 |
+
app.listen(port, () => {
|
| 17 |
+
console.log(`Server is running at http://localhost:${port}`);
|
| 18 |
+
});
|