eo

express-obc

Object-based controllers for Express framework

Showing:

Popularity

Downloads/wk

5

GitHub Stars

0

Maintenance

Last Commit

8yrs ago

Contributors

0

Package

Dependencies

1

Size (min+gzip)

11.6KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Express OBC

Express is a server-side web application framework for NodeJS platform.

Express OBC is a collection of objects that provide easy-to-use higher-level API for handling requests in Express-based apps. OBC stands for object-based controllers. As the name suggests, these controllers are based on object-oriented design rather than functional/callback-based approach which is the default in Express.

Express OBC is still in early development, and as such it is not widely used. It currently implements only two basic controllers: base controller (or just 'controller') and template controller, which augments the base controller by providing methods for rendering views.

Installation

Express OBC can be installed using NPM:

npm install express-obc

Basic usage

Here is an example of a basic Express OBC controller.

var controller = require('express-obc').controller;
var myController = Object.create(controller);

myController.route = '/hello/:name.:ext';
myController.allowedMethods = ['get'];
myController.get = function () {
  this.respond({name: this.req.params.name});
};

myController.route(app);

Now if we hit the /hello/foxbunny.json URL, we will receive a JSON response containing {"name": "foxbunny"}.

Documentation

Documentation in markdown format can be found in the doc directory.

Reporting bugs

Please report all bugs to GitHub issue tracker.

License

Express OBC is published under the MIT license.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100