Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib cf-autoconfig version 0.1.0 Aug 6, 2012
.gitignore cf-autoconfig version 0.1.0 Aug 6, 2012
.npmignore cf-autoconfig version 0.1.0 Aug 6, 2012
LICENSE.txt cf-autoconfig version 0.1.0 Aug 6, 2012
NOTICE.txt cf-autoconfig version 0.1.0 Aug 6, 2012 cf-autoconfig version 0.1.0 Aug 6, 2012


cf-autoconfig is a Node.js module that reconfigures server and service functions so they can automatically run on Cloud Foundry without manual configuration.


npm install cf-autoconfig

If cloned from github install dependencies:

npm install -d


Require this on the first line of your start script:


That's it!

Reconfigured functions

cf-autoconfig reconfigures functions of modules listed below if they are accessible in node require path or on any level of node_modules folder tree. This means that any modules that depend on these reconfigured modules will also be reconfigured.

Server setup

Core module: "net" Functions:

  • Server.listen()

Plus all functions that inherit from this one. This includes core http.Server.listen and https.Server.listen. And node modules functions that wrap this one, like express's app.listen function.

Mongodb connection

Module: mongodb Functions:

  • connect()
  • new Db()
  • new Server()
  • db.authenticate()

Module: mongoose

  • (and other mongoose functions that wrap this one)

Mysql connection

Module: mysql Functions:

  • createClient()
  • Client._connect() (other functions and modules use this for auto connect)

Postgresql connection

Module: pg Functions:

  • defaults (default connection variables)
  • connect()
  • new Client()

Redis connection

Module: redis Functions:

  • createClient()
  • auth()

Rabbitmq connection

Module: amqp Functions:

  • createConnection()
  • new Connection()