{"id":16144227,"url":"https://github.com/ryanj/config-multipaas","last_synced_at":"2025-03-18T17:31:47.712Z","repository":{"id":21514233,"uuid":"24833331","full_name":"ryanj/config-multipaas","owner":"ryanj","description":"A config-chain wrapper that checks common cloud configs, providing autoconfiguration for several cloud hosting environments","archived":false,"fork":false,"pushed_at":"2018-08-23T23:29:55.000Z","size":20,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T11:22:53.899Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.org/package/config-multipaas","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-06T03:43:41.000Z","updated_at":"2019-08-13T15:52:15.000Z","dependencies_parsed_at":"2022-08-21T16:21:06.747Z","dependency_job_id":null,"html_url":"https://github.com/ryanj/config-multipaas","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanj%2Fconfig-multipaas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanj%2Fconfig-multipaas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanj%2Fconfig-multipaas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanj%2Fconfig-multipaas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanj","download_url":"https://codeload.github.com/ryanj/config-multipaas/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243944583,"owners_count":20372832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T00:11:58.771Z","updated_at":"2025-03-18T17:31:47.213Z","avatar_url":"https://github.com/ryanj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#config-multipaas [![npm version](http://img.shields.io/npm/v/config-multipaas.svg)](https://www.npmjs.org/package/config-multipaas) [![Build Status](http://img.shields.io/travis/ryanj/config-multipaas.svg)](https://travis-ci.org/ryanj/config-multipaas)\n\n[CONFIG-CHAIN](https://github.com/dominictarr/config-chain) W/ [CLOUD-ENV](https://github.com/ryanj/cloud-env/) DEFAULTS!\n\n**!!AUTOCONFIGURE JS CODE FOR USE ON ANY PLATFORM NODE!!**\n\n![MultiPaaS](http://i.imgur.com/fCi6YX6.png)\n\n[Config-multiPaaS](https://github.com/ryanj/config-multipaas) is a [`config-chain`](https://github.com/dominictarr/config-chain) wrapper that includes autoconfiguration support for all major cloud hosting platforms and deployment targets:\n\n* [OpenShift](https://developers.openshift.com/languages/nodejs/environment-variables.html#listen)\n* [Heroku](https://devcenter.heroku.com/articles/dynos#web-dynos)\n* [Modulus](http://help.modulus.io/customer/portal/articles/1660583)\n* [CloudFoundry](http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html#PORT)\n\nIt works by [checking the system environment for known configuration strings](https://github.com/ryanj/cloud-env/), normalizing the results into a [consistent list](#configuration-strings).\n\n[![npm stats](https://nodei.co/npm/config-multipaas.png?downloads=true\u0026stars=true)](https://www.npmjs.org/package/config-multipaas)\n\n[![Dependency Check](http://img.shields.io/david/ryanj/config-multipaas.svg)](https://david-dm.org/ryanj/config-multipaas) [![monthly downloads](http://img.shields.io/npm/dm/config-multipaas.svg)](https://www.npmjs.org/package/config-multipaas) [![license](http://img.shields.io/npm/l/config-multipaas.svg)](https://www.npmjs.org/package/config-multipaas)\n\n## Setup\n\nConfiguration objects generated by `config-multipaas` are valid instances of [`config-chain`](https://www.npmjs.org/package/config-chain), making it easy to extend, or to use as drop-in replacement:\n\n``` js\n  //npm install --save config-multipaas\n  var cc = require('config-multipaas')\n\n  // Merge multiple layers of configuration down into a single set:\n  var config_overrides = { foo: \"bar\" } // override values should be provided first\n  var config = cc(config_overrides)     // cloud configs will be automatically resolved\n                 .add({ PORT: 8000 })   // low-priority defaults should be appended last\n```\n\nThe above example will produce a default `PORT` value of `8000` when autoconfiguration strings are unavailable - as in local development environments.  On all platforms, `foo` will be resolved as `\"bar\"`.\n\nSee the [`config-chain README`](https://github.com/dominictarr/config-chain#boring-api-docs) for advanced usage notes, and the below list of [configuration strings](#configuration-strings) for more information about cloud-provided configs.\n\n## Listen up\nMake sure to pass `config.get('PORT')` and `config.get('IP')` to your app's `listen` function:\n\n```js\napp.listen(config.get('PORT'), config.get('IP'), function () {\n  console.log(\"Listening on \"+config.get('IP')+\", port \"+config.get('PORT'))\n});\n```\n\nIf host-provided configs are not found, local development defaults are returned - allowing you to configure once, and run anywhere.\n\n## Configuration Strings\nConsistent, vendor-neutral, server configuration strings [provoded by `cloud-env`](https://github.com/ryanj/cloud-env#configuration-strings):\n\nconfig.get(KEYNAME) | DEFAULT | process.env.SOURCE_VARS \n--------------------|-----------|---------------\nIP                  | 0.0.0.0 | OPENSHIFT_NODEJS_IP, BIND_IP \nPORT                | 8080  | OPENSHIFT_NODEJS_PORT, PORT\nHOSTNAME            | localhost  | OPENSHIFT_APP_DNS, HOSTNAME \nAPP_NAME            | APP_NAME  | OPENSHIFT_APP_NAME, APP_NAME\nMONGODB_DB_URL      | mongodb://127.0.0.1:27017  | OPENSHIFT_MONGODB_DB_URL, MONGODB_DB_URL\nPOSTGRESQL_DB_URL   | postgresql://127.0.0.1:5432  | OPENSHIFT_POSTGRESQL_DB_URL, POSTGRESQL_DB_URL\nMYSQL_DB_URL      | mysql://127.0.0.1:3306  | OPENSHIFT_MYSQL_DB_URL, MYSQL_DB_URL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanj%2Fconfig-multipaas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanj%2Fconfig-multipaas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanj%2Fconfig-multipaas/lists"}