Savory/Danet

Support handlebar template engine

Sorikairox opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
We should be able to render an HTML generated by Handlebars.

Describe the solution you'd like
A @View('viewname') decorator for controller methods
DanetRouter should get a TemplateEngine attribute that will render the given view, with variables returned from the controller's method.

Here is an example:

@Controller('')
class myController {

  @View('index')
  renderIndex() {
return { latestNews: ['an array of latests', 'news to display'] };
  }
}

Additional context
Take inspiration of nestjs

https://docs.nestjs.com/techniques/mvc