Skip to content

Instantly share code, notes, and snippets.

View edgarogh's full-sized avatar

Edgar Onghena edgarogh

View GitHub Profile
{
"type": "object",
"additionalProperties": true,
"dependencies": {
"slot": {
"type": "object",
"required": [
"features"
],
"properties": {
import { Req, Res } from "./express.types";
import { NextFunction } from "express";
/**
* This middleware adds two functions to the response object to make it easier
* to build a JSON API.
*/
export default function jsonApiMiddleware() {
return (req: Req, res: Res, next: NextFunction) => {
res.jsonData = (json) => {

Keybase proof

I hereby claim:

  • I am edgarogh on github.
  • I am edgaronghena (https://keybase.io/edgaronghena) on keybase.
  • I have a public key ASC4Nz7OVdQrgtsL94sOHVs_gl3YODNQ-n-wzZ8juHq8Owo

To claim this, I am signing this object: