GithubHelp home page GithubHelp logo

serverify's Introduction

serverify

Starts a server running browserify so you can quickly develop web applications using the node.js/npm package system.

Usage

Here is how to run the example in test/. First, install the serverify command globally:

sudo npm install -g serverify

Next, go into the test directory and run it:

cd test/
serverify

And that should start the server! You can navigate your browser to http://localhost:8080/index.html to view the test page.

Configuration

By default, serverify bundles up the file called index.js in the directory which it is run from and servers up static files contained in the ./www/ directory. The bundle is served at /bundle.js. You can configure this behavior using the following parameters:

  • entry: (Default: ./index.js) The entry point for the project.
  • www: (Default: ./www/) The static HTML directory
  • bundle: (Default: /bundle.js) The web path to serve up the bundled project on.
  • port: (Default: 8080) The port on which the server is hosted.

These parameters can be changed in one of the following ways:

  • You can override them via the command line, eg:

      serverify --entry test.js
    
  • You can create a file called .serverify in the same directory as your project which contains a JSON string describing the values for the parameters:

    `echo "{port:9001}" > .serverify && serverify`
    

Why not just run browserify --watch?

This only solves half the problem. You still need to launch a web server to host the files so that you can view them in your browser.

Why not use browserify-server?

browserify-server is a bit more substantial and offers some extra features, like autogenerated scaffolding, configurable Makefiles and the ability to bundle images and HTML. If you want this stuff, then by all means go use it. On the other hand, if you just want to run a server with browserify and nothing else, then serverify may be a better solution.

What about browservefy?

Because I only found out about browservefy recently. Though very similar to serverify, it has a few small differences:

  • browservefy is not carefully documented. (Though one could debate how important this is for such a trivial task)
  • It also creates a default index.html, which you may or may not want.
  • Also you can't specify the path for static HTML files, which again you may or may not care about.

Credits

(c) 2013 Mikola Lysenko. MIT License

serverify's People

Contributors

mikolalysenko avatar

Stargazers

 avatar wanghes avatar Randall A. Gordon avatar

Watchers

 avatar James Cloos avatar  avatar

serverify's Issues

browserify-server

Can you open issues about all your problems with browserify-server on my repo then we can discuss and fix them.

I also find browserify-server annoying. I currently use it mainly for --example where it scaffolds out an example folder like ( https://github.com/Raynos/browserify-server/tree/master/resources )

For example this folder ( https://github.com/Raynos/topology/tree/master/examples/fully ) is scaffolded out.

I would love to collab on the simplest way to run and dev an example for a browserify module

cc @chrisdickinson

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.