Coder Social home page Coder Social logo

sencisho's Introduction

sencisho

Description

A simple http server for local development, built on top of Node.js

Usage

npm install -g sencisho

From the directory you want to serve static files:

sencisho [options]

Options

--port -p Port number

--live -l Enable livereload

--browser -b Specify browser

--watch -w Additional paths to watch

--silent -s Don't automatically open a browser

--responses -r Specify a json file containing a response map

when using the -r/--responses option, livereload will be enabled

Examples

Start in default port

sencisho

Start in specified port

sencisho --port 8888 or sencisho -p 8888

Enable livereload

sencisho --live or sencisho -l

Open in other browser than your system default

sencisho --browser opera or sencisho -b opera

Add additional paths to the file watcher

sencisho --watch js/*.js or sencisho -w js/*.js

Don't automatically open a browser

sencisho --silent or sencisho -s

Specify a json file containing a response map

sencisho --responses api.json or sencisho -r api.json

Example:

{
  "/api/test": {

    "headers": {
      "Content-type": "application/json",
      "Access-Control-Allow-Origin": "*",
      "Access-Control-Allow-Headers": "X-Requested-With"
    },

    "statusCode": 200,

    "body": {
      "name": "Something",
      "data": [1, 2, 3, 4, 5]
    }
  }
}

The only required property is the body but you can specify headers and a statusCode

All at once (may be passed in any order)

sencisho -p 8888 -l -b opera -w js/*.js -s -r api.json

Misc

  • What's up with that name?

    It's a long story

Authors/Contributors

sencisho's People

Contributors

julien avatar dciccale avatar

Stargazers

 avatar Matt Hernandez avatar Javier Mendiara avatar

Watchers

 avatar James Cloos avatar  avatar

sencisho's Issues

Allow connections from outside your computer

When developing an app, sometimes publishing a web server in 0.0.0.0 instead of localhost is desirable to allow connections from outside your own computer.

Adding a --server 0.0.0.0 (or similar), defaulting to localhost, will solve the problem

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.