1.0.0 • Published 4 years ago

ninjahost v1.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

ninjahost

Serve directories over HTTP at your favorite Port.

Installation

Install from Command Line:

npm i ninjahost

Usage

  • Make a file myhost.js.

  • Write below code in the file.

    const ninjahost = require('ninjahost');
    const { resolve } = require('path');
    
    const dir = resolve(__dirname, 'build');
    const port = 6000;
    
    // below code serves 'build' directory at port 6000
    // dir path must be absolute
    ninjahost(dir, port);
    
    ...

    If port is not specified, then 1123 will be used as the default port.

  • Run below command in the command line.

    node myhost.js
  • Now go to the below url in your favorite browser.

    http://localhost:6000

Ninja Hacking ;)