Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 1.05 KB

sails.config.custom.md

File metadata and controls

29 lines (19 loc) · 1.05 KB

Custom configuration

What is this?

The custom configuration for your app. This is useful for one-off settings specific to your application, like the domain to use when sending emails, or third-party API keys for Stripe, Mailgun, Twitter, Facebook, etc.

These values are usually set in the config/custom.js file and may be overridden in production using config/env/production.js, environment variables, or any of the other configuration mechanisms provided by Sails.

Example

First, to set custom configuration:

// config/custom.js
module.exports.custom = {
  mailgunDomain: 'transactional-mail.example.com',
  mailgunApiKey: 'key-testkeyb183848139913858e8abd9a3'
};

Then, to access these values from your actions and helpers, use sails.config.custom:

sails.config.custom.mailgunApiKey;
// -> "key-testkeyb183848139913858e8abd9a3"