Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

..
Octocat-spinner-32 lib
Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .npmignore
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 NOTICE.txt
Octocat-spinner-32 Readme.md
Octocat-spinner-32 package.json
Readme.md

cf-autoconfig

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

Installation

npm install cf-autoconfig

If cloned from github install dependencies:

npm install -d

Usage

Require this on the first line of your start script:

require("cf-autoconfig");

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

  • Connection.open() (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()
Something went wrong with that request. Please try again.