Static, localhost server with optional public/ dir and port.
npm install bare-static-server
port
defaults to 5000
const { init } = require("bare-static-server")
const port = ...,
public = ...
init({ public: "./www" })
Assuming dir ./www exists and it contains index.txt we may now:
curl http://127.0.0.1:5000/index.txt