0.1.47 • Published 7 years ago

transactions-express-rest-mongodb v0.1.47

Weekly downloads
7
License
MIT
Repository
-
Last release
7 years ago

transactions-express-rest-mongodb

npm version

Documentation comes soon... You can see for now how the simple tests work for understanding the (de)lightness of the api.

require('babel-polyfill') const express = require('express') const http = require('http') const { MongoClient } = require('mongodb') const { useRouter } = require('transactions-express-rest-mongodb')

const app = express()

MongoClient.connect('mongodb://localhost:27017/demo') .then(({ db }) => {

// use here the transactions middleware with a certain api path useRouter(app, { db, routePath: '/data' })

http.Server(app) .listen(5000, function () { console.log('Server available at http://0.0.0.0:5000') }) })

mongo demo --eval "db.authors.insert([{ name: 'Karl' }, { name: 'Albert' }])"
require('babel-polyfill')
const express = require('express')
const http = require('http')
const { MongoClient } = require('mongodb')
const { useRouter } = require('transactions-express-rest-mongodb')

const app = express()

MongoClient.connect('mongodb://localhost:27017/demo')
  .then(({ db }) => {

    // use here the transactions middleware with for a certain api path
    useRouter(app, { db, routePath: '/data' })

    http.Server(app)
      .listen(5000, function () {
        console.log('Server available at http://0.0.0.0:5000')
      })
  })
curl -X GET "http://localhost:5000/data/authors"
curl -X PUT -H "Content-Type: application/json" -d '{ "query": { "name": "Albert" }, "update": { "name": "Robert" } }' "http://localhost:5000/data/authors"
0.1.47

7 years ago

0.1.46

7 years ago

0.1.45

7 years ago

0.1.44

7 years ago

0.1.42

8 years ago

0.1.41

8 years ago

0.1.40

8 years ago

0.1.39

8 years ago

0.1.38

8 years ago

0.1.37

8 years ago

0.1.36

8 years ago

0.1.35

8 years ago

0.1.34

8 years ago

0.1.32

8 years ago

0.1.31

8 years ago

0.1.30

8 years ago

0.1.29

8 years ago

0.1.28

8 years ago

0.1.27

8 years ago

0.1.25

8 years ago

0.1.24

8 years ago

0.1.23

8 years ago

0.1.22

8 years ago

0.1.21

8 years ago

0.1.20

8 years ago

0.1.19

8 years ago

0.1.18

8 years ago

0.1.17

8 years ago

0.1.16

8 years ago

0.1.15

8 years ago

0.1.14

8 years ago

0.1.13

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago