Skip to content

Commit ea60bcc

Browse files
author
vedantoncloud
committed
feat: update app.js for CI/CD output
1 parent 669d849 commit ea60bcc

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

app.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
const http = require('http');
2-
const port = process.env.PORT || 3000;
1+
const express = require("express");
2+
const app = express();
33

4-
const server = http.createServer((req, res) => {
5-
if (req.url === '/health') return res.end('OK');
6-
res.end('Hello from MyApp - ' + (process.env.NODE_ENV || 'dev'));
4+
app.get("/", (req, res) => {
5+
res.send("Hello from MyApp - CI/CD Working!");
76
});
87

9-
server.listen(port, () => {
10-
console.log(`Server running on port ${port}`);
8+
const PORT = process.env.PORT || 3000;
9+
app.listen(PORT, () => {
10+
console.log(`Server running on port ${PORT}`);
1111
});
12+
13+
module.exports = app;

0 commit comments

Comments
 (0)