-
Notifications
You must be signed in to change notification settings - Fork 1
simple rails style controller for use with the express framework for nodejs
wbg/express-base-controller
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
I for one truly love to separate different parts of my code, so adding dedicated controller classes was the first thing i did when playing around with the express framework for nodejs. It is not at all a fancy implementation that tries to reimplement big frameworks like Ruby on Rails or Django, but rather a small script that provides what I need at the moment.
Usage is really simple:
* Create a new express app
express --sessions application-name
* Checkout express-base-controller into your expressjs app folder
* Add the following line to your app.js
require('./express-base-controller/base_controller.js').init_routes(app);
Thats more or less it. After starting your app using 'node app.js' you should be able to access the example controller's index action using http://localhost:3000/example-controller and the test action using http://localhost:3000/example-controller/test.
To write your own controllers simply add them to express-base-controller/controllers.
The main idea was outlined at http://roman-weinberger.net/blog/adding-rails-style-controllers-to-the-express-framework-for-node-js/About
simple rails style controller for use with the express framework for nodejs
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published