react-server-middleware-json-response

0.6.1 • Public • Published

JSON Response middleware for React Server

Use this middleware to return a JSON-serialized object from a React Server page.

import JsonResponseMiddleware from "react-server-middleware-json-response"
 
export default class DataEndpoint {
    static middleware() {
        return [JsonResponseMiddleware];
    }
 
    getResponseData() {
        return { result: "OK!" };
    }
}

Package Sidebar

Install

npm i react-server-middleware-json-response

Weekly Downloads

6

Version

0.6.1

License

Apache-2.0

Last publish

Collaborators

  • avastu
  • drewpc
  • gigabo