huli-env

1.0.1 • Public • Published

Húlí Environment Service

This little package is responsible to provide connection-object for MySQL connections.

By default it uses the standard RDS environment variables, but it can be overriden with a custom connection-object

The connection object must contain the following keys:

{
  "host": "",
  "port": "",
  "user": "",
  "password": "",
  "database": "",
}

the default connection-object is:

{
  host: process.env.RDS_HOSTNAME,
  port: process.env.RDS_PORT,
  user: process.env.RDS_USER,
  password: process.env.RDS_PASSWORD,
  database: process.env.RDS_DATABASE,
}

The module exports two function:

One is to get the default (or occasionaly injected) connection-object

function getDBConn(connObj)

and the other is to override the default connection-object

function setDBConn(connObj)

Package Sidebar

Install

npm i huli-env

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

1.86 kB

Total Files

3

Last publish

Collaborators

  • donbattery