alajs

nodeJs mvc framework

ALAJS Get Started

ALAJS is a simple mvc framework based on koa.Thank you very much, you are a great middle framework!

1. npm install alajs --save          
2. npm -g install node-dev     
var alajs = require('alajs');
App = alajs({           /*please set the App to gobal*/
	name 		: 	'ALABLOG',
	databases	: 	{
		default:  'mysql:root@localhost/test',
		log 		: 'mongodb://localhost/test'
	},
	models 		: 	['/share/models']
});
App.define.module({
	name 			:   'root',
	url 			: 	'/',
	path 			: 	'/app',
	controllers		: 	['/controllers','/otherCtrls'],
	staticResources : 	'/static',
})
App.define.defaultModule('root');
var server = App.define.server({port:3000});
server.loader(App);
server.bootstrap();
var welcome = App.define.controller({name:'welcome',url:'/welcome'})
welcome('you',function *(next){

	this.body = 'You are welcome!'

})
node-dev --debug --harmony app.js

12. Visit http://localhost:3000/welcome/you