Super Simple Web Server

1.1.4 · maintenance · verified Tue Apr 21

Super Simple Web Server (super-simple-web-server) is a lightweight Node.js CLI utility designed for quickly serving static files via HTTP and HTTPS on localhost, primarily intended for development and testing purposes. Currently at version 1.1.4, with its last major update in March 2021, the package is in a maintenance state, fulfilling its specific niche without active feature development or a regular release cadence. A key feature is the inclusion of pre-generated, self-signed SSL certificates for HTTPS support, explicitly noted to be unsuitable for production environments and set to expire on June 6, 2028. It distinguishes itself by offering a "fire-and-forget" setup via `npm start` with optional command-line arguments for web root and custom CommonJS middleware, making it ideal for rapid prototyping or isolated local development without complex server configurations. While primarily a CLI tool, it also exposes a programmatic `startServer` function for more controlled integration within Node.js applications.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates installation, basic server startup, serving from a specified directory, adding custom CommonJS middleware, and configuring ports via environment variables.

npm install super-simple-web-server

# To serve files from the current directory on default ports (HTTP 3000, HTTPS 3001)
npm start

# To serve files from a specific directory, e.g., './public'
npm start ./public

# Create a middleware.js file:
# // middleware.js
# module.exports = (app) => {
#   app.get('/api/data', (req, res) => res.json({ message: 'Data from API', timestamp: Date.now() }));
# };

# To serve files from './public' with custom middleware from './middleware.js'
npm start ./public ./middleware.js

# To change default ports, e.g., HTTP on 8080, HTTPS on 8443
SSWS_HTTP_PORT=8080 SSWS_HTTPS_PORT=8443 npm start

view raw JSON →