Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kbarbounakis/most-web-vash
Most Web Framework Vash View Engine
https://github.com/kbarbounakis/most-web-vash
Last synced: 1 day ago
JSON representation
Most Web Framework Vash View Engine
- Host: GitHub
- URL: https://github.com/kbarbounakis/most-web-vash
- Owner: kbarbounakis
- License: other
- Created: 2016-03-21T16:15:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-03-22T07:24:27.000Z (over 8 years ago)
- Last Synced: 2024-09-14T08:39:59.415Z (2 months 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-vash
Most Web Framework Vash View Engine![MOST Web Framework Logo](https://www.themost.io/assets/images/most_logo_sw_240.png)
A view engine for [vash](https://github.com/kirbysayshi/vash) 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-vash
## Usage
Register view engine by adding the following node in config/app.json engines collection:
"engines": [
...
{
"name": "Vash View Engine", "extension": "vash", "type": "most-web-vash"
}
...
]
}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:
This a Vash example
Hello @model.data.name!
Place it in views folder:
app
+ views
+ example
hello.html.vashand finally execute the action /example/hello.html