Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wankdanker/greenhorn
A simple server that renders HTML using various engines and a configuration file with test data
https://github.com/wankdanker/greenhorn
Last synced: 14 days ago
JSON representation
A simple server that renders HTML using various engines and a configuration file with test data
- Host: GitHub
- URL: https://github.com/wankdanker/greenhorn
- Owner: wankdanker
- Created: 2016-03-29T04:37:42.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-05-10T15:24:07.000Z (over 8 years ago)
- Last Synced: 2024-12-06T02:08:48.172Z (about 1 month ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
greenhorn
---------A simple application intended to provide an easy way to hand off development of HTML views/templates
to an uninitiated or outside developer. Greenhorn reads a greenhorn.json file which contains some basic
information including the data context in which a template is rendered. This allows one to provide only
sample data and not the entire application when all that needs to be developed is an HTML view.install
-------```shell
npm install -g greenhorn
```usage
-----### Create a new directory
```shell
$ mkdir my-project
$ cd my-project
```### Create a greenhorn.json file
```json
{
"title" : "product-view",
"data" : {
"sku" : "12345",
"name" : "Thingamabob"
},
"static" : [{
"root" : "./static"
}],
"routes" : [{
"url" : "/customer",
"view" : "/customer/profile.ejs",
"data" : {
"customerCode" : "THINGAMABOBBERS",
"name" : "Thing-A-Ma-Bobbers",
"balance" : 42.00
}
}]
}
```### Execute
```shell
$ greenhorn
```
With debugging information...
```shell
$ DEBUG=* greenhorn
```### Develop your view
For example test.jade
### Open your browser
Open your browser to http://localhost:5000/test.jade
todo
----* add support for remote greenhorn.json
* add support for specifying greenhorn.json path via argv
* add web interface
* load remote greenhorn.json
* load a specific /path
* selectable datasets to apply to a viewlicense
-------MIT