Module: libs/reqmodel

libs/reqmodel

This module creates properties initializing on each router express.Request and assigning to req.model.

Based on environment value definded in app.json is included at runtime original source or compiled (minify) files by using keys extCSS and extJS.

The object locality defined user locality information such as language code.

The locales object refers to the values of localization messages. This object builds based on your files names in your locales directory plus localization keys.

The routerBase providing path for the current router.

Version:
  • 1.0
See:

Examples

conf/app.json { "environment": "dev" ... }

head.template.html

<html lang="<%= locality.langugage %>"> <meta charset="UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title><%= locales.content.pageTitle %></title>

<link rel="stylesheet" href="css/bootstrap<%= extCSS %>" media="screen"> <link rel="stylesheet" type="text/css" href="css/custom.less">

<script src="js/vendor/require-2.1.15<%= extJS %>" data-main="js<%= routerBase %>/main-<%= environment %>"></script>