Code Monkey home page Code Monkey logo

bunk's Introduction

bunk

a decidedly featureless, low dependency http server to serve static resource files, with cli support

Getting Started

Install it globally for use on the command line.

$ npm install -g bunk

CLI Usage

The most basic way to use bunk is to run on the terminal:

$ bunk

This will serve all static files within the current working directory at localhost:7070.

Options

For more "advanced" usage, include in the command:

  -d, --dir <dir>    directory of static files to serve, default: .
  -p, --port <port>  port to run http server on, default: 7070

For exmaple, to serve the directory build/production on port 1337, run on the terminal:

$ bunk -d build/production -p 1337

It is recommended, but not required, that you have an index.html within the root of the directory being served.

API Usage

Install it as a local dependency for use within another module.

$ npm install --save bunk
$ npm install --save-dev bunk

Then require and call bunk with or without options

var bunk = require('bunk');

bunk()
// => bunk: serving . on port 7070

bunk({dir:'build/production', port:1337})
// => bunk: serving build/production on port: 1337

Credits

This module was heavily inspired by an example usage of serve-static.

bunk's People

Contributors

json2d avatar

Watchers

 avatar  avatar

bunk's Issues

Problem using cli on OSX

Running the command (including variations with options):

$ bunk

yields:

env: node\r: No such file or directory

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.