Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kbarbounakis/most-web-jade
Most Web Framework Jade View Engine
https://github.com/kbarbounakis/most-web-jade
Last synced: 1 day ago
JSON representation
Most Web Framework Jade View Engine
- Host: GitHub
- URL: https://github.com/kbarbounakis/most-web-jade
- Owner: kbarbounakis
- License: other
- Created: 2016-03-21T06:18:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-03-22T06:08:32.000Z (over 8 years ago)
- Last Synced: 2024-10-12T23:30:34.495Z (about 1 month ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# most-web-jade
Most Web Framework Jade View Engine![MOST Web Framework Logo](https://www.themost.io/assets/images/most_logo_sw_240.png)
A view engine for [jade](https://github.com/pugjs/pug) templates which are going to be used in web applications based on [MOST Web Framework](https://github.com/kbarbounakis/most-web)
## Install
$ npm install most-web-jade
## Usage
Register view engine by adding the following node in config/app.json engines collection:
"engines": [
...
{
"name": "Jade View Engine", "extension": "jade", "type": "most-web-jade"
}
...
]
}Create a new controller (app/controllers/example-controller.js):
var web = require("most-web"), util = require("util");
function ExampleController() {
ExampleController.super_.call(this);
}util.inherits(ExampleController, web.controllers.HttpBaseController);
ExampleController.prototype.hello = function(callback) {
return callback(null, this.result({ name:"Thomas" }));
}Create a jade template:
h1 This is a Jade template
h2 Hello #{data.name}Place it in views folder:
app
+ views
+ example
hello.html.jadeand finally execute the action /example/hello.html