Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/indatawetrust/koa2-knex
knex middleware for koa2
https://github.com/indatawetrust/koa2-knex
Last synced: about 1 month ago
JSON representation
knex middleware for koa2
- Host: GitHub
- URL: https://github.com/indatawetrust/koa2-knex
- Owner: indatawetrust
- Created: 2017-11-18T14:27:16.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-18T14:40:31.000Z (almost 7 years ago)
- Last Synced: 2024-10-01T02:21:44.089Z (about 2 months ago)
- Language: JavaScript
- Size: 1.76 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# koa2-knex
knex middleware for koa2koa2-knex
===================Knex.js Middleware for Koa2. Package is versioned in step with
### 0. Installation (via [npm](https://npmjs.org/package/koa2-knex))
```bash
$ npm install koa2-knex --save
```### 1. Usage (contrived example)
```javascript
const knex = require('koa2-knex');
...
app.use(knex({
client: 'pg',
connection: {
/** typical knex connection object */
}
});```
### 2. Options
The following environment variables will be automatically used for the Knex.js connection object if set:
```
KOA_KNEX_HOST
KOA_KNEX_PORT
KOA_KNEX_USER
KOA_KNEX_PASSWORD
KOA_KNEX_DATABASE
KOA_KNEX_CHARSET
KOA_KNEX_SSL
KOA_KNEX_DEBUG
```
### License[MIT](http://www.opensource.org/licenses/mit-license.php)