Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const express = require('express');

const app = express();
const PORT = process.env.PORT || 3000;

app.get('/goodbye', (req, res) => {
res.send('Goodbye, World!');
});

app.listen(PORT, () => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

App not exported: The app is created and immediately bound to a port, but never exported. This prevents writing integration tests that import the app directly (e.g., with supertest). Consider adding module.exports = app; and guarding the listen call with if (require.main === module) so the server only starts when run directly.

console.log(`Server running on port ${PORT}`);
});
Loading