JSPM

@typescriptlibs/svr

0.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q43276F
  • License MIT

Simple HTTP(S) Server

Package Exports

  • @typescriptlibs/svr
  • @typescriptlibs/svr/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@typescriptlibs/svr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Svr: Simple HTTP(S) Server

This package provides a simple HTTP(S) server to deliver HTML, TypeScript, and other files to web browsers.

CodeQL Node.js NPM License

Examples

  • Start a HTTPS server with html folder as the website's root:

    npx svr --https --root html
  • Start a HTTP server with log files:

    npx svr 1>> svr.log 2>> svr-error.log

Options

All options are optional.

  • --cgi [path]: Activates CGI path for web browsers.

  • --http [port]: Activates HTTP port. Port number is optional.

  • --https [port]: Activates HTTPS port. Port number is optional. Without httpsCert and httpsKey a sels-signed certificate will be created instead (requires OpenSSL).

  • --httpsCert [file]: File path to the HTTPS certificate.

  • --httpsKey [file]: File path to the HTTPS key.

  • --root [folder]: Root folder with files for web browsers.

  • --stop [seconds]: Stops the server after the given amount of seconds.

Redirect Output

The following patterns follow last.

  • 1> [file]: Redirect request log to a file. Replaces an existing file.

  • 1>> [file]: Redirect request log to a file. Append to existing file.

  • 2> [file]: Redirect error log to a file. Replaces an existing file.

  • 2>> [file]: Redirect error log to a file. Append to existing file.