Giter Site home page Giter Site logo

shooss's Introduction

shooss - super http u* static server NPM version

Super simple yet comprehensive static files server. Shooss ๐ŸŽฟ

Credits

Based on Shuss by ArnaudRinquin

Installation

Shooss requires Node.js to run.

npm install shooss

You'd probably want it in available globally, with:

npm install -g shooss

Livereload

To enjoy the pleasure of the livereload feature, just follow the official browser extension installation guide. Easy.

Settings

Shooss loads settings in that order:

  1. defaults
  2. env
  3. -f <file>
  4. cli args

There are very few settings, all defaulted.

  • port: 1234
  • dir: '.'
  • livreload: false
  • livereloadport: 35729
  • verbose: false

CLI usage

$ > shooss -h
shooss [options...]

Options:
  -d, --dir          Served files directory                 [default: "."]
  -p, --port         Runs Shooss on the specified port       [default: "1234"]
  --verbose          Speak to me
  -l, --livereload   Enables LiveReload
  --livereload_port  Runs LiveReload on the specified port  [default: "35729"]
  -f, --file         Config file path
  -v, --version      Return actual Shooss version
  -h, --help         Displays Shooss help

Default usage:

$ > shooss
info: serving /Users/arnaud/projects/shooss on http://0.0.0.0:1234

Specific port and livereload (on default port):

$ > shooss -p 6543 -l
info: serving /Users/arnaud/projects/shooss on http://0.0.0.0:6543

Now with verbose, specified, port and livereload port

$ > shooss -p 6543 --verbose -l --livereload_port 6523
info: serving /Users/romain/Projects/shooss on http://0.0.0.0:6543
debug: starting server on port 6543
debug: starting livereload server on port 6523

ENV variables

Shooss can load settings from these self-explanatory values:

  • SHUSS_PORT
  • SHUSS_LR
  • SHUSS_LR_PORT
  • SHUSS_DIR
  • SHUSS_VERBOSE

JSON File

You can specify a config file to load:

$ > shooss -f config.json

It is expected to contain json, like in this:

$ > cat config.json
{
  "port":8000,
  "livereload": true,
  "livereloadport": 9854,
  "verbose": true,
  "dir": "./public"
}

plugins

While being very simple, Shooss can handle complexe plugins.

Using a plugin

To use a plugin, you will probably have to install them in the same scope as shooss. Chances are you must install them globaly:

npm i -G shooss-my-awesome-plugin

Then, you just have to specify the comma separated list of plugins you want to use, along with their own arguments. Here is an example with shooss-basic-auth

shooss --plugins basic-auth --username admin --password foobar

Available plugins

Writing a plugin

A plugin is a npm package prefixed by shooss-. Plugins can act on:

You are allowed to add your own cli args.

All they have to define is a load(app, express, config) function. See the basic-auth example.

Development

All Shooss Node.js module are written in CoffeeScript.

In order to use correctly the shooss binary, you have to compile them in JavaScript.

It can be done through:

$ grunt coffee:compile

Or more easily:

$ grunt

Todo

Features

  • test config solver, urgent, not how to do it yet, maybe node-env-file
  • any idea?

Integration

So much to do!

  • grunt-shooss
  • gulp-shooss
  • atom-shooss
  • sublime-shooss
  • younameit-shooss

Contributing

Contributors and CONTRIBUTING

License

Released under the MIT License. See the LICENSE file for further details.

shooss's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.