UNPKG

1.34 kBMarkdownView Raw
1HAPI Application Server
2========================================
3
4HAPI server to ease the creation and integration of applications that consume the HAPI API.
5
6This is used by HAPI.App to server up HAPI applications.
7
8Installation
9----------------------------------------
10
11DO NOT INSTALL NPM DIRECTLY! THIS IS JUST USED BY HAPI.APP!
12
13Custom MiddleWares for Express.
14----------------------------------------
15
16You can specify custom middlewares to be used in the application server by creating an `app.server.config.json` file in the folder from where you start the server.
17The file must contain an array of paths to middleware modules.
18
19e.g.
20
21```json
22[
23 "tamperMW",
24 "./mw/yourMiddleWare"
25]
26```
27
28We provide a set of default modules which you can find in `src/modules`. To use these default modules you just need to specify their name (without the extension) as they appear in the `src/modules` folder.
29
30By default the application will use the modules specified in the `default.app.server.config.json` file in the root of this repo.
31
32Be aware that the order in which the modules are specified in the config file is meaningful. The application will load them in sequence.
33
34Custom middlewares need to implement a specific interface which exposes the following method:
35
36```coffeescript
37configure: ({app: app, callback: callback}) ->
38```