Skip to content

loopback postgres connector that can be configured with environment variable tokens

Notifications You must be signed in to change notification settings

arthurmilliken/loopback-connector-pgenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

loopback-connector-pgenv

loopback postgres connector that can be configured with environment variable tokens

Usage

In a loopback application, add an entry to server/datasources.json, with the "properties" section containing the properties to pass into the postgresql connector. Values can be replaced with $ENV_VARIABLE_NAME, like this:

"myDataSource": {
	"connector": "pgenv",
	"properties": {
		"name": "myDataSource",
		"connector": "postgresql",
		"url": "$DATABASE_URL"
	}
}

This will replace the "url" setting with the value of the DATABASE_URL environment variable.

This can also use the following format:

"myDataSource": {
	"connector": "pgenv",
	"properties": {
		"name": "myDataSource",
		"host": "$DB_HOST",
		"port": "$DB_PORT",
		"database": "$DB_NAME",
		"username": "$DB_USER",
		"password": "$DB_PASS",
		"connector": "postgresql",
		"ssl": true
	}
}

About

loopback postgres connector that can be configured with environment variable tokens

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published