javascript
Published on January 26, 2024By DeveloperBreeze
// Import 'http' module
const http = require('http');
// Create a simple HTTP server
const server = http.createServer((req, res) => {
res.end('Hello, Node.js!');
});
// Start the server and listen on port 3000
server.listen(3000, () => {
console.log('Server is listening on port 3000');
});
Comments
Please log in to leave a comment.