arango-express

1.0.0 • Public • Published

arango-express

This is a middleware that attaches query and transaction functions to the Express request object.

Install

npm install arango-express

Usage

const { arangodb } = require('arango-express')
const express = require('express')

const app = express()

app.use(
  arangodb({
    db: 'mydb',
    as: {
      username: 'mike',
      password: 'secret',
    },
  }),
)

app.get('/', async function (req, res) {
  const cursor = await req.query`RETURN CURRENT_USER()`
  const dbuser = await cursor.next()
  res.send(`Hello from ${dbuser}!')
})

Readme

Keywords

none

Package Sidebar

Install

npm i arango-express

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

4.75 kB

Total Files

5

Last publish

Collaborators

  • mikewilliamson