themible
=========

Themible Module to set up the theme (to customize the web presentation) and locales (for internationalization) of a node.js express application.

[![npm version](https://badge.fury.io/js/themible.svg)](http://badge.fury.io/js/themible)
[![Build Status](https://travis-ci.org/telefonica/node-themible.svg)](https://travis-ci.org/telefonica/node-themible)
[![Coverage Status](https://img.shields.io/coveralls/telefonica/node-themible.svg)](https://coveralls.io/r/telefonica/node-themible)

## Installation

```bash
npm install themible
```

## Examples

Set theme middlewares:

```javascript
var themible = require('tdaf-themible');

// Express Server Code
var app = express();
try {
  themible(app, '/etc/myConfig/theme', '/context/theme', 'es');
} catch (err) {
  // Handle exception
}
```

The module expects three parameters and one optional:
* **app**. It is the express application where middleware for themes, favicon and locales are applied.
* **themeDir**. Directory with 2 subdirectories:
  * **public** directory with the theme web resources
  * **locales** with the JSON files for localization
* **themePath**. URL path where the **public** subdirectory is published.
* **defaultLocale**. It sets the default locale of the module.

## Errors:
The following file has registered the errors generated by this library:
[errors.json](errors.json)

## Changelog:

### v1.1.0 (10-01-2016)
- Allow to set default locale parameter.

### v1.0.0 (25-06-2015)
- First version
