DeveloperBreeze

Simple HTTP Server in Node.js

// 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');
});

Continue Reading

Handpicked posts just for you — based on your current read.

Discussion 0

Please sign in to join the discussion.

No comments yet. Start the discussion!