@mikwal/node-http-server
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

NodeJS HTTP server

Lightweight http server for NodeJS micro services with optional static resources.

Listening port can be specified by options.port argument, in package.json/httpServer/port or by setting the environment variable PORT. (the latter takes precedence).

A health check URL can be specified by options.healthCheckUrl argument or in package.json/httpServer/healthCheckUrl.

Static resources can be specified in options.assets argument or in package.json/httpServer/assets. Keys in the map is the physical file or directory and values are the relative URL.

A relative URL in argument options.assetsManifestPath or package.json/httpServer/assetsManifestPath to expose a list of all static resources.

Usage:

let { runHttpServer } = require('@mikwal/node-http-server');

runHttpServer((request, response) => {
    response.end('Echo for URL=' + request.url);
});

/@mikwal/node-http-server/

    Package Sidebar

    Install

    npm i @mikwal/node-http-server

    Weekly Downloads

    0

    Version

    0.1.7

    License

    none

    Unpacked Size

    17.6 kB

    Total Files

    8

    Last publish

    Collaborators

    • mikwal