View
appolo view module
#
Installationthe view engine must be installed in package.json
in the example npm i nunjucks
.
#
Optionskey | Description | Type | Default |
---|---|---|---|
viewFolder | view folder to search the view paths | string | views |
viewCache | cache the compiled views | boolean | true |
viewExt | views files extension | string | html |
viewEngine | the view engine to be used from list | string | nunjucks |
maxPathCache | max number of cached view paths | number | 1000 |
in config/modules/all.ts
#
Usagenow you can use the res.render function in the controller
if the path is not defined the view will be searched in the same folder as the controller and file name as the action in the example below it will search for view2.html
the view can be rendered with view
decorator
promises also supported