Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@middy/http-router

Package Overview
Dependencies
Maintainers
0
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@middy/http-router - npm Package Compare versions

Comparing version 5.4.7 to 5.5.0

20

index.js
import { createError } from '@middy/util'
const httpRouteHandler = (routes) => {
const defaults = {
routes: [],
notFoundResponse: ({ method, path }) => {
const err = createError(404, 'Route does not exist', {
cause: { package: '@middy/http-router', data: { method, path } }
})
throw err
}
}
const httpRouteHandler = (opts = {}) => {
if (Array.isArray(opts)) {
opts = { routes: opts }
}
const { routes, notFoundResponse } = { ...defaults, ...opts }
const routesStatic = {}

@@ -59,5 +73,3 @@ const routesDynamic = {}

// Not Found
throw createError(404, 'Route does not exist', {
cause: { package: '@middy/http-router', data: path }
})
return notFoundResponse({ method, path })
}

@@ -64,0 +76,0 @@ }

6

package.json
{
"name": "@middy/http-router",
"version": "5.4.7",
"version": "5.5.0",
"description": "HTTP event router for the middy framework",

@@ -63,6 +63,6 @@ "type": "module",

"dependencies": {
"@middy/util": "5.4.7"
"@middy/util": "5.5.0"
},
"devDependencies": {
"@middy/core": "5.4.7",
"@middy/core": "5.5.0",
"@types/aws-lambda": "^8.10.97"

@@ -69,0 +69,0 @@ },

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