New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

json_api

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json_api

Simple JSON REST API for NeDB (or MongoDB)

  • 0.0.0
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

JSON API

A simple middleware for mounting a RESTful JSON API

Usage

Add as a middleware

var Datastore = require('nedb');
var store     = new Datastore({ filename: "path/to/file", autoload: true });
var json_api  = require("json_api");

app.use("/path/to/mount/to", json_api(store));

create a record:

curl -4 -X POST -H "Content-Type: application/json" -d '{"name":"curl"}' http://localhost:8025/path/to/mount/to

get a record:

curl -4 -X GET -H "Content-Type: application/json" http://localhost:8025/path/to/mount/to/<resource-id>

I have only tested with NeDB but should also work with MongoDB

Check out the tests to see more usage examples.

Testing

npm install -g mocha
mocha

FAQs

Package last updated on 21 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc