const http = require('http'); const hostname = '127.0.0.1'; const port = 3000; const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader('Content-Type', 'text/html'); res.end('Hello world'); }); server.listen(port, hostname, () => { console.log(`Server running at http://${hostname}:${port}/`); });
Terminal
Online Node.js Compiler
What is Node.js
Node.js is a JavaScript runtime built on Chrome's V8 engine that lets you run JavaScript on the server. It enables building APIs, servers, and full stack applications using JavaScript across client and server.
What is an online Node compiler
An online Node compiler provides a server-like environment in the browser where you can run Node scripts and experiment with backend logic without installing Node locally. It's useful for small experiments and learning server-side concepts quickly.
Want to learn Node.js?
Take a look at our Complete Full-Stack Developer Roadmap, with in-browser code playground and interactive widgets to accelerate your learning.
We help you master Node.js by building real projects, no more learning without doing, no more tutorial hell.