npm / server.js
r3hab's picture
Create server.js
7d47185 verified
raw
history blame contribute delete
334 Bytes
// Simple HTTP server
const http = require('http');
const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello World from Node.js in Docker!\n');
});
const PORT = process.env.PORT || 3000;
server.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});