eng
Eng Engine is a framework that uses the concept of MVC node.js
Installation
With node:
# Get the latest stable release of Eng $ sudo npm install eng -g // require -g
Your First Eng Project
Create a new Project:
# Create the app $ eng install // and follow instruction
Next Run Project:
# cd into the new folder $ cd tester # fire up the server $ eng run // or node server.js
Removing Project:
$ eng uninstall project_name
MVC Controller
Application/Controll/home.js:
export.home = }; // run: http://localhost:8080/home/ or http://localhost:8080/
Create Controller Project:
$ eng create_controller // and follor instruction example: test
Eng will generate code:
export.test = }; // run: http://localhost:8080/test/
Create any method:
export.test = home_second: this.setContent; } }; // run: http://localhost:8080/test/second/
Create __construct:
export.test = , home_index: this.setContent; } }; // run: http://localhost:8080/test/
Create autoload Model & Library:
export.test = , home_index: this.setContent; } }; // Create Model in Application/Model/user.js export.user = }; // Create Library in System/Lib/libs.js export.libs = }; // run: http://localhost:8080/test/
MVC Model
Create function for transaction with database [ mysql / mongodb / etc ] with modul from node.js and create function here
Create Example Model: Application/Model/user.js:
export.user = };
Example Call Model from Controller:
export.test =
MVC View
Create view in format html in folder Application/View/ .html: and you can include ejs here:
Create View Example: Application/View/index.html:
<html> <head> <title> <%= title %> </title> </head> <body> <h1> <%= body %> </h1> </body> </html>
Example Call View from Controller and send data to View:
export.test = };
Group on G+ Follow Twitter
Thanks to Nodejs
Ukungzulfah