node-oracledb middleware for Koa v2
This is a fork of https://github.com/viniciusam/koa-oracledb. I updated dependencies, and changed a bit.
npm install koa-oracledb-middleware --save
const Koa = require('koa');
const app = new Koa();
const KoaOracle = require('koa-oracledb-middleware');
var db = new KoaOracle({
user: process.env.NODE_ORACLEDB_USER,
password: process.env.NODE_ORACLEDB_PASSWORD,
connectString: process.env.NODE_ORACLEDB_CONNECTIONSTRING
});
app.use(db.middleware());
or
const Router = require('koa-router');
const KoaOracle = require('koa-oracledb-middleware');
var poolV1 = new KoaOracle({
user: process.env.NODE_ORACLEDB_USER,
password: process.env.NODE_ORACLEDB_PASSWORD,
connectString: process.env.NODE_ORACLEDB_CONNECTIONSTRING
});
var router = new Router({ prefix: '/v1' });
router.use(poolV1.middleware());
You can find a full example on examples/example.js.
MIT