2.0.3 • Published 6 years ago

static-cling v2.0.3

Weekly downloads
4,324
License
Unlicense
Repository
github
Last release
6 years ago

Static Cling

Build Status npm version

This is a node.js module that allows you to spin up a static file server either from code or from the command line.

Installing

npm install static-cling

Don't forget to use the global flag (--g) if you want the command line option everywhere.

At the command line

static

Yeah, that's it. You have the option to pass in -p for port, otherwise it defaults to port 3000, -d for directory, if you want to specify a different directory than the one you are in, and lastly -f for the default html page, this defaults to index.html

In Code

Static Cling is available to be used as a module as well if you want to use node to host static files.

require('static-cling')();

Options

If using the module you can override the defaults by providing a config object

//defaults
var config = {
    root: '.',
    port: 3000,
    filename: 'index.html'
}
const cling = require('static-cling')
//overriding defaults
cling({ port: 3456, root : './other/', filename: 'test.html' });
2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.6

12 years ago

0.1.5

12 years ago

0.0.5

12 years ago

0.0.4

13 years ago

0.0.3

13 years ago

0.0.1

13 years ago