Skip to content

Instantly share code, notes, and snippets.

@email2vimalraj
Last active April 12, 2017 19:49
Show Gist options
  • Save email2vimalraj/3c4f35a41c58a55a0ffd00c3e64142c8 to your computer and use it in GitHub Desktop.
Save email2vimalraj/3c4f35a41c58a55a0ffd00c3e64142c8 to your computer and use it in GitHub Desktop.
ExtentX Connection
/**
* Connections
* (sails.config.connections)
*
* `Connections` are like "saved settings" for your adapters. What's the difference between
* a connection and an adapter, you might ask? An adapter (e.g. `sails-mysql`) is generic--
* it needs some additional information to work (e.g. your database host, password, user, etc.)
* A `connection` is that additional information.
*
* Each model must have a `connection` property (a string) which is references the name of one
* of these connections. If it doesn't, the default `connection` configured in `config/models.js`
* will be applied. Of course, a connection can (and usually is) shared by multiple models.
* .
* Note: If you're using version control, you should put your passwords/api keys
* in `config/local.js`, environment variables, or use another strategy.
* (this is to prevent you inadvertently sensitive credentials up to your repository.)
*
* For more information on configuration, check out:
* http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.connections.html
*/
module.exports.connections = {
/***************************************************************************
* *
* Local disk storage for DEVELOPMENT ONLY *
* *
* Installed by default. *
* *
***************************************************************************/
localDiskDb: {
adapter: 'sails-disk'
},
/***************************************************************************
* *
* MySQL is the world's most popular relational database. *
* http://en.wikipedia.org/wiki/MySQL *
* *
* Run: npm install sails-mysql *
* *
***************************************************************************/
// someMysqlServer: {
// adapter: 'sails-mysql',
// host: 'YOUR_MYSQL_SERVER_HOSTNAME_OR_IP_ADDRESS',
// user: 'YOUR_MYSQL_USER', //optional
// password: 'YOUR_MYSQL_PASSWORD', //optional
// database: 'YOUR_MYSQL_DB' //optional
// },
/***************************************************************************
* *
* MongoDB is the leading NoSQL database. *
* http://en.wikipedia.org/wiki/MongoDB *
* *
* Run: npm install sails-mongo *
* *
***************************************************************************/
extent: {
adapter: 'sails-mongo',
host: (typeof process.env.MONGODB_PORT_27017_TCP_ADDR === 'undefined') ? 'localhost' : process.env.MONGODB_PORT_27017_TCP_ADDR, // host where MongoDB is running
port: (typeof process.env.MONGODB_PORT_27017_TCP_PORT === 'undefined') ? 27017 : process.env.MONGODB_PORT_27017_TCP_PORT, // port where MongoDB is running
database: 'extent'
},
/***************************************************************************
* *
* PostgreSQL is another officially supported relational database. *
* http://en.wikipedia.org/wiki/PostgreSQL *
* *
* Run: npm install sails-postgresql *
* *
* *
***************************************************************************/
// somePostgresqlServer: {
// adapter: 'sails-postgresql',
// host: 'YOUR_POSTGRES_SERVER_HOSTNAME_OR_IP_ADDRESS',
// user: 'YOUR_POSTGRES_USER', // optional
// password: 'YOUR_POSTGRES_PASSWORD', // optional
// database: 'YOUR_POSTGRES_DB' //optional
// }
/***************************************************************************
* *
* More adapters: https://github.com/balderdashy/sails *
* *
***************************************************************************/
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment