Skip to content

Commit

Permalink
Update app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
siyoungoh authored Apr 9, 2024
1 parent b7e0892 commit 5146505
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const http = require('http');

const hostname = '0.0.0.0';
const port = 3000;

const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello, World!\n');
});

server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
const PORT = process.env.PORT || 8080;

server.listen(PORT, () => {
console.log(`Server running on http://localhost:${PORT}/`);
});

0 comments on commit 5146505

Please sign in to comment.