0.1.1 • Published 7 years ago

nest-rest-api v0.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

#nest-rest-api

A rest api for the nest library.

Requirements

  • MongoDB up and running
  • Node >=6.9.1

Installation

$ npm install nest-rest-api

Usage

File index.js

const nestApi = require('nest-rest-api')
const routes = require('./routes')

// nest configuration
nestApi.setup({
  workers: 4,         // Set the amount of workers scraping in parallel to 4
  mongo: {
    db: 'nest',       // Use the 'nest' mongo collection
    host: '127.0.0.1' // Connect to the Mongo process running at localhost
    port: '27017'     // Connect to the Mongo process running at port 27017
  },
  routes              // Routes
})

// start server
nestApi.app.listen(3000)

Start nest

curl http://localhost:3000/queue/start

Api

EndpointMethodDescription
/queue/startGETStart nest
/queue/stopGETStop nest
/queue/statusGETStatus of nest
/jobsGETJob list
/jobsPOSTCreate a job
/itemsGETItem list
/items/:itemIdGETItem information

Examples

View the ./examples directory for working examples.

License

MIT