Skip to content

Latest commit

 

History

History
138 lines (88 loc) · 3.45 KB

README.md

File metadata and controls

138 lines (88 loc) · 3.45 KB

Noder.io-app

DEPRECATED !

This package is deprecated.

Works only with noder.io@v0 and Express 3.


Actual version published on NPM Dependencies

noder.io-app is a light starter toolkit to start and organize quickly an application with Node.js. Noder.io-app provides express and other features (router that support the named routes, express-load, ...).

noder.io-app is an extension of Noder.io.

If noder.io is not installed, it will be installed during the installation of noder.io-app.

  • In progress:
    • online documentation, API doc and tutorials (multilingual, french and english from the start)
    • starter kit for start quickly a project Node.js (without unnecessary overhead, nor imposed modules)
    • standalone and portable noder package

Getting Started

noder.io-app require node.js 0.10 or higher.

Install noder

Via NPM :

npm install noder.io-app

Usage

// load the modules noder.io + noder.io-app into the noder variable
var noder = require('noder.io-app');

// shortcut, noder application (it uses express)
var app = noder.app;

// display the environment of execution
console.log(noder.conf.get('env'));

// named route
app.post({path: '/hello/:name', as:'hello'}, function(req, res){
  res.end('Hello ' + req.name);
});

// script loader
noder.load('config')
  .then('routes')
  .into(app);

// ...

If you already use noder.io, this also works :

// load noder.io into the noder variable
var noder = require('noder.io');

// Add noder.io-app into the noder variable
require('noder.io-app');

// shortcut, noder application (it uses express)
var app = noder.app;

// display the environment of execution
console.log(noder.conf.get('env'));

// named route
app.post({path: '/hello/:name', as:'hello'}, function(req, res){
  res.end('Hello ' + req.name);
});

// script loader
noder.load('config')
  .then('routes')
  .into(app);

// ...

Static server

Very useful for quickly run a HTTP server.

node node_modules/.bin/noder-server --help

Usage: noder-server [options]

Options:

-h, --help         output usage information
-s, --static       Run a static server
-r, --root <path>  The root path (default: public)
-p, --port <port>  The port (default: 3000)
--debug            Debug mode
node node_modules/.bin/noder-server --static --debug --port 8080

Open your browser on http://localhost:8080 it works :)

Testing

Noder.io-app is tested with Unit.js and Mocha. Unit.js is a powerful and intuitive unit testing framework for javascript.

Contributing

Contributions are welcome, you are welcome :)

License

Copyright (c) 2014, Nicolas Tallefourtane.

BSD 2, see LICENSE file for more info.

Author

Nicolas Tallefourtane - Nicolab.net
Nicolas Talle
Make a donation via Paypal