This commit is contained in:
24
index.js
24
index.js
@@ -0,0 +1,24 @@
|
||||
const express = require("express");
|
||||
const app = express();
|
||||
|
||||
app.use(express.json());
|
||||
|
||||
app.get("/", (req, res) => {
|
||||
res.send("🚀 Home Route Working");
|
||||
});
|
||||
|
||||
app.get("/health", (req, res) => {
|
||||
res.json({
|
||||
status: "OK",
|
||||
message: "Server is healthy ✅"
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
|
||||
// only start server if not testing
|
||||
if (require.main === module) {
|
||||
app.listen(3000, () => {
|
||||
console.log("Server running on port 3000");
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user