Skip to content
This repository has been archived by the owner on Mar 27, 2018. It is now read-only.
/ restify-render Public archive

Working proof of concept for having template rendering in Restify

License

Notifications You must be signed in to change notification settings

greduan/restify-render

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

restify-render

Proof of concept for having template rendering in Restify, i.e. having interactive apps in Restify.

Usage

For a full example you can take a look at test/server.js.

Otherwise, here's a quick start:

const render = require('restify-render');
const cons = require('consolidate');

// assign res.render()
app.use(render({
  engine: cons.pug,
  dir: __dirname + '/views',
}));

// basic use of res.render()
server.get('/:name', function (req, res) {
  res.render('view.pug', { name: req.params.name || 'Jason' });
});

License

Copyright (c) 2016 Eduardo Lavaque <[email protected]>
This work is free.  You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar.  See the LICENSE file for more details.

About

Working proof of concept for having template rendering in Restify

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published