Practice Lab

nodejs Skills Challenge

Master your nodejs expertise with interactive coding missions and real-time validation.

EasyServer & Core

Create a Basic HTTP Server

Create a function that returns an HTTP server configuration object with { port, host, routes }. The routes array should contain objects with { method, path, handler } for GET '/' returning 'Hello World' and GET '/health' returning { status: 'ok' }.

Guidelines

  • No global variables
  • No side effects
  • No external dependencies

Example Scenario

createServerConfig(3000) -> { port: 3000, host: 'localhost', routes: [ { method: 'GET', path: '/', response: 'Hello World' }, { method: 'GET', path: '/health', response: { status: 'ok' } } ] }
Loading...