Advertisement
Guest User

connections.js

a guest
Jul 31st, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 4.79 KB | None | 0 0
  1. /**
  2.  * Connections
  3.  * (sails.config.connections)
  4.  *
  5.  * `Connections` are like "saved settings" for your adapters.  What's the difference between
  6.  * a connection and an adapter, you might ask?  An adapter (e.g. `sails-mysql`) is generic--
  7.  * it needs some additional information to work (e.g. your database host, password, user, etc.)
  8.  * A `connection` is that additional information.
  9.  *
  10.  * Each model must have a `connection` property (a string) which is references the name of one
  11.  * of these connections.  If it doesn't, the default `connection` configured in `config/models.js`
  12.  * will be applied.  Of course, a connection can (and usually is) shared by multiple models.
  13.  * .
  14.  * Note: If you're using version control, you should put your passwords/api keys
  15.  * in `config/local.js`, environment variables, or use another strategy.
  16.  * (this is to prevent you inadvertently sensitive credentials up to your repository.)
  17.  *
  18.  * For more information on configuration, check out:
  19.  * http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.connections.html
  20.  */
  21.  
  22. module.exports.connections = {
  23.  
  24.   /***************************************************************************
  25.    *                                                                          *
  26.    * Local disk storage for DEVELOPMENT ONLY                                  *
  27.    *                                                                          *
  28.    * Installed by default.                                                    *
  29.    *                                                                          *
  30.    ***************************************************************************/
  31.   localDiskDb: {
  32.     adapter: 'sails-disk'
  33.   },
  34.  
  35.   /***************************************************************************
  36.    *                                                                          *
  37.    * MySQL is the world's most popular relational database.                   *
  38.    * http://en.wikipedia.org/wiki/MySQL                                       *
  39.    *                                                                          *
  40.    * Run: npm install sails-mysql                                             *
  41.    *                                                                          *
  42.    ***************************************************************************/
  43.   // someMysqlServer: {
  44.   //   adapter: 'sails-mysql',
  45.   //   host: 'YOUR_MYSQL_SERVER_HOSTNAME_OR_IP_ADDRESS',
  46.   //   user: 'YOUR_MYSQL_USER', //optional
  47.   //   password: 'YOUR_MYSQL_PASSWORD', //optional
  48.   //   database: 'YOUR_MYSQL_DB' //optional
  49.   // },
  50.  
  51.   /***************************************************************************
  52.    *                                                                          *
  53.    * MongoDB is the leading NoSQL database.                                   *
  54.    * http://en.wikipedia.org/wiki/MongoDB                                     *
  55.    *                                                                          *
  56.    * Run: npm install sails-mongo                                             *
  57.    *                                                                          *
  58.    ***************************************************************************/
  59.   mongodb: {
  60.     adapter   : 'sails-mongo',
  61.     ssl: {
  62.       rejectUnauthorized: false
  63.     },
  64.     url: 'mongodb://localhost:27017/secret-deals-devDB'
  65.   },
  66.  
  67.   /***************************************************************************
  68.    *                                                                          *
  69.    * PostgreSQL is another officially supported relational database.          *
  70.    * http://en.wikipedia.org/wiki/PostgreSQL                                  *
  71.    *                                                                          *
  72.    * Run: npm install sails-postgresql                                        *
  73.    *                                                                          *
  74.    *                                                                          *
  75.    ***************************************************************************/
  76.   // somePostgresqlServer: {
  77.   //   adapter: 'sails-postgresql',
  78.   //   host: 'YOUR_POSTGRES_SERVER_HOSTNAME_OR_IP_ADDRESS',
  79.   //   user: 'YOUR_POSTGRES_USER', // optional
  80.   //   password: 'YOUR_POSTGRES_PASSWORD', // optional
  81.   //   database: 'YOUR_POSTGRES_DB' //optional
  82.   // }
  83.  
  84.  
  85.   /***************************************************************************
  86.    *                                                                          *
  87.    * More adapters: https://github.com/balderdashy/sails                      *
  88.    *                                                                          *
  89.    ***************************************************************************/
  90.  
  91. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement