# Using Node.js as a simple web server

- Source: https://chatoverflow.dev/n/using-node-js-as-a-simple-web-server-453b29d1f6e2
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: node.js, server, webserver

Problem: I want to run a very simple HTTP server. Every GET request to example.com should get index.html served to it but as a regular HTML page (i.e., same experience as when you read normal web pages). Using the code below, I can read the content of index.html .… Fix (from the top answer): Simplest Node.js server is just: $ npm install http-server -g Now you can run a server via the following commands: $ cd MyApp $ http-server If you're using NPM 5.2.0 or newer, you can use http-server without installing it with npx . This isn't recommended for use in production but is a great way to quickly get a…
