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

jsonapi-server

Package Overview
Dependencies
Maintainers
3
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonapi-server - npm Package Compare versions

Comparing version 0.14.0 to 0.15.0

lib/MemoryHandler.js

2

CHANGELOG.md

@@ -43,1 +43,3 @@ 2015-06-29 - Initial release

2015-11-17 - v0.14.0
2015-11-18 - Rename MockHandler to MemoryHandler
2015-11-18 - v0.15.0

8

documentation/resources.md

@@ -15,9 +15,9 @@

jsonapi-server ships with an example barebones implementation of an in-memory handler. It can be found at `jsonApi.MockHandler`. You can use it as a reference for writing new handlers.
jsonapi-server ships with an example barebones implementation of an in-memory handler. It can be found at `jsonApi.MemoryHandler`. You can use it as a reference for writing new handlers.
Documentation for creating your own handlers can be found [here](handlers.md).
`MockHandler` works by allowing each defined resource to contain an `examples` property, which must be an array of JSON objects representing raw resources. Those examples are loaded into memory when the server loads and are served up as if they were real resources. You can search through them, modify them, create new ones, delete them, straight away.
`MemoryHandler` works by allowing each defined resource to contain an `examples` property, which must be an array of JSON objects representing raw resources. Those examples are loaded into memory when the server loads and are served up as if they were real resources. You can search through them, modify them, create new ones, delete them, straight away.
Its a beautiful way of prototyping an experimental new API! Simply define the attributes of a resource, attach the `MockHandler` and define some `examples`:
Its a beautiful way of prototyping an experimental new API! Simply define the attributes of a resource, attach the `MemoryHandler` and define some `examples`:

@@ -27,3 +27,3 @@ ```javascript

resource: "photos",
handlers: new jsonApi.MockHandler(),
handlers: new jsonApi.MemoryHandler(),
attributes: {

@@ -30,0 +30,0 @@ title: jsonApi.Joi.string()

@@ -7,3 +7,3 @@ var jsonApi = require("../../.");

description: "Represents the core content, people love to read articles.",
handlers: new jsonApi.MockHandler(),
handlers: new jsonApi.MemoryHandler(),
searchParams: {

@@ -10,0 +10,0 @@ query: jsonApi.Joi.string()

@@ -7,3 +7,3 @@ var jsonApi = require("../../.");

description: "Allow people to attach short messages to articles",
handlers: new jsonApi.MockHandler(),
handlers: new jsonApi.MemoryHandler(),
searchParams: { },

@@ -10,0 +10,0 @@ attributes: {

@@ -7,3 +7,3 @@ var jsonApi = require("../../.");

description: "Used to attribute work to specific people.",
handlers: new jsonApi.MockHandler(),
handlers: new jsonApi.MemoryHandler(),
searchParams: { },

@@ -10,0 +10,0 @@ attributes: {

@@ -7,3 +7,3 @@ var jsonApi = require("../../.");

description: "Used to represent all the images in the system.",
handlers: new jsonApi.MockHandler(),
handlers: new jsonApi.MemoryHandler(),
searchParams: { },

@@ -10,0 +10,0 @@ attributes: {

@@ -7,3 +7,3 @@ var jsonApi = require("../../.");

description: "Used to group resources together, useful for finding related resources.",
handlers: new jsonApi.MockHandler(),
handlers: new jsonApi.MemoryHandler(),
searchParams: { },

@@ -10,0 +10,0 @@ attributes: {

@@ -14,3 +14,3 @@ "use strict";

jsonApi.Joi = ourJoi.Joi;
jsonApi.MockHandler = require("./MockHandler");
jsonApi.MemoryHandler = require("./MemoryHandler");

@@ -17,0 +17,0 @@ jsonApi.setConfig = function(apiConfig) {

{
"name": "jsonapi-server",
"version": "0.14.0",
"version": "0.15.0",
"description": "A fully featured NodeJS sever implementation of json:api. You provide the resources, we provide the api.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -32,3 +32,3 @@ [![Coverage Status](https://coveralls.io/repos/holidayextras/jsonapi-server/badge.svg?branch=master)](https://coveralls.io/r/holidayextras/jsonapi-server?branch=master)

resource: "photos",
handlers: new jsonApi.MockHandler(),
handlers: new jsonApi.MemoryHandler(),
attributes: {

@@ -35,0 +35,0 @@ title: jsonApi.Joi.string()

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