Nomadic People Migration
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    xstaticpublic

    Xstatic

    Xstatic is a minimal static file server for node.js. Basically, it's to be used when you need to get something simple up and running to serve http content.

    Install

    If you use npm, then install static via npm. also remember to put it as a dependency in your package.json file.

    npm install xstatic
    

    If you don't use npm, you can just grab the static.js and copy it to your project locally.

    Examples

    For use in a simple http server:

     
    var http = require('http');
    var xstatic = require('xstatic');
     
    http.createServer(xstatic()).listen(1337);
     

    Options

    Currently, the only thing you can change about how the files are served up is defining mimetypes. By default there is a list of common mimetypes to allow you to easily call xstatic() without any parameters. If you want to supply your own list of mime type mappings you can send it to xstatic like:

     
    var http = require('http');
    var xstatic = require('xstatic');
     
    http.createServer(xstatic({
      mimeTypes: {
        "html": "text/html",
        "coffee": "text/coffeescript"
      }
    }).listen(1337);

    Keywords

    none

    install

    npm i xstatic

    Downloadsweekly downloads

    0

    version

    0.0.3

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar