Configuration for your app's underlying HTTP server. These properties are conventionally specified in the
config/http.js configuration file.
||See conventional defaults for HTTP middleware||A dictionary of all HTTP middleware functions your app will run on every incoming HTTP request.
||See conventional defaults for HTTP middleware order||An array of middleware names (strings) indicating the order in which middleware should be run for all incoming HTTP requests.|
||The number of milliseconds to cache static assets when your app is running in a 'production' environment.
These are any flat files like images, scripts, stylesheets, etc. that are served by Express' static middleware (by default, these files are served from
||SSL only: options to send directly to the Node
- Note that this HTTP middleware stack configured in
sails.config.http.middlewareis only applied to true HTTP requests-- it is ignored when handling virtual requests (e.g. sockets)
- The middleware named
routeris what handles all of your app's explicit routes (i.e.
sails.config.routes) as well as shadow routes that are injected for blueprints, policies, etc.
- You cannot define a custom middleware function with the key
sails.config.http.middleware.orderhas special meaning)
Is something missing?
If you notice something we've missed or could be improved on, please follow this link and submit a pull request to the sails-docs repo. Once we merge it, the changes will be reflected on the website the next time it is deployed.
- Blueprint API
- Command Line Interface
- Response (`res`)
- Waterline (ORM)
- Resourceful PubSub
- Socket Client
We wrote a book!
Get early access to the book
with promotion code: mcneildoc