Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Updating documentation with detail on how to add and use custom Expre…
Browse files Browse the repository at this point in the history
…ss middleware, currently undocumented
  • Loading branch information
robskillington committed Aug 5, 2013
1 parent 04dca80 commit 678dc69
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions config.express.md
@@ -0,0 +1,19 @@
# Express
This configuration file lets you easily add [Express](http://expressjs.com/) middleware, local variables and helpers for templates and directly access the application instance before it starts.

```javascript
module.exports.express = {

customMiddleware: false

/*
// Say you want to use `connect-flash` for messaging within a session
customMiddleware: function (app) {
var flash = require('connect-flash');
app.use(flash());
}
*/

};
```
3 changes: 3 additions & 0 deletions config.md
Expand Up @@ -19,6 +19,9 @@
####[CSRF](https://github.com/balderdashy/sails-wiki/blob/0.9/config.csrf.md)
>When enabled, all non-GET requests to the Sails server must be accompanied by a special token, identified as the '_csrf' parameter.
####[Express](https://github.com/balderdashy/sails-wiki/blob/0.9/config.express.md)
>If you want to use custom middleware or add local variables and helpers to templates you can do so by configuring express in this config file.
####[Local](https://github.com/balderdashy/sails-wiki/blob/0.9/config.local.md)
>While you’re developing your app, this config file should include any settings specifically for your development computer (db passwords, etc.)
Expand Down

0 comments on commit 678dc69

Please sign in to comment.