steffentchr / bomberjs

The early stages of a node.js web framework

Home Page:http://bomber.obtdev.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bomber is a node.js web framework inspired by Rails, Django and anything else out there that has caught our eye.

Main website and documentation: http://bomber.obtdev.com/

Warning! Right now the API is very much in a state of flux. We are still experimenting with the best way to make Bomber both intuitive and powerful. Expect things to change a lot for the forseeable future.

Getting up and running

The source code for Bomber is located on GitHub. To check it out, run the following command:

git checkout git://github.com/obt/bomberjs.git

The easiest way to try it out is to cd into the example project and run the following command to start the server (assuming you have Node installed and in your path):

cd bomberjs/exampleProject
../bomber.js server

Brief summary

Bomber is centered around the idea of 'apps'. Apps are just a bunch of functionality wrapped up into a folder.

Here is what an app folder structure could look like:

app-name/
  ./routes.js
  ./views/
    ./view-name.js

Here is an example routes.js file:

var Router = require('bomber/lib/router').Router;
var r = new Router();

r.add('/:view/:action/:id');
r.add('/:view/:action');

exports.router = r;

Here is an example view file:

exports.index = function(request, response) {
  return "index action";
};
exports.show = function(request, response) {
  if( request.format == 'json' ) {
    return {a: 1, b: 'two', c: { value: 'three'}};
  }
  else {
    return "show action";
  }
};

Participating

We are open to new ideas and feedback, so if you have any thoughts on ways to make Bomber better, or find any bugs, please feel free to participate in the Google Group.

Relevant Reading

About

The early stages of a node.js web framework

http://bomber.obtdev.com/

License:MIT License


Languages

Language:JavaScript 97.3%Language:Ruby 2.7%