Files
node-code/index.js
Gitea 6838b2754c
All checks were successful
Node API Test / test (push) Successful in 24s
fifth commit
2026-04-16 15:51:19 +05:30

24 lines
445 B
JavaScript

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");
});
}