UNPKG

server-mockup-api

Version:

To get full fake REST API with no efforts. Add/Modify API endpoint and response through JSON file.

16 lines (15 loc) 450 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.middleware = void 0; /* eslint-disable @typescript-eslint/no-explicit-any */ const middleware = (req, res, next) => { if (req.method === 'GET' || req.method === 'POST' || req.method === 'PUT' || req.method === 'DELTE' || req.method === 'PATCH') { req.method = 'GET'; } next(); }; exports.middleware = middleware;