Difficulty: beginner
Estimated Time: 10-15 minutes

This is an introduction ;)

foo bar

Hello World

The following snippet can be copied into the editor:

var http = require('http');
var requestListener = function (req, res) {
  res.end('Hello, World!');

var server = http.createServer(requestListener);
server.listen(3000, function() { console.log("Listening on port 3000")});

Code can be executed with the syntax node app.js

The following will automatically be turned into a link and proxied to port 3000 - http://[[CLIENT_SUBDOMAIN]]-3000-[[KATACODA_HOST]].environments.katacoda.com/

In a multi-host environment, such as Docker, use HOST_SUBDOMAIN instead of CLIENT_SUBDOMAIN.

Live example at https://www.katacoda.com/courses/nodejs/playground