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

@everestate/serverless-router

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@everestate/serverless-router - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

20

docs/plugins.md

@@ -5,3 +5,3 @@ The router delegates route matching to its plugins. So, routing subject could be represented with anything: object, string or even number. The plugin is responsible to provide the matching machanism.

1. We need to declare new class which is extended from 'BasePlugin':
1. We need to declare new class which is extended from "`BasePlugin`":

@@ -15,3 +15,3 @@ ```javascript

2. Router expects plugin to provide one or more public intefaces available to plugin users.
2. Router expects plugin to provide one or more public interfaces available to plugin users.

@@ -59,2 +59,17 @@ ```javascript

The plugin would be accessible on router's instance by lower-cased class name as
```javascript
const router = new Router([EvenOdd]);
router.evenodd.even();
```
The accessibility alias could be customized with
```javascript
class EvenOdd extends BasePlugin {
static get pluginName() { return 'foobar'; }
}
```
That's basically it, let's try it out now:

@@ -93,4 +108,3 @@

Also some real plugin packages:
* [serverless-router-web](https://github.com/everestate/serverless-router-web)
* [serverless-router-aws](https://github.com/everestate/serverless-router-aws)
* [serverless-router-dynamics](https://github.com/everestate/serverless-router-dynamics)

9

package.json
{
"name": "@everestate/serverless-router",
"version": "0.3.0",
"description": "Dependency-free, minimalist, pluggable, universal router.",
"version": "0.3.1",
"description": "Serverless, minimalist, pluggable, universal router.",
"keywords": [

@@ -30,4 +30,7 @@ "serverless",

"license": "MIT",
"publishConfig": {
"access": "public"
},
"devDependencies": {
"eslint": "^5.10.0",
"eslint": "^5.11.1",
"eslint-config-airbnb-base": "^13.1.0",

@@ -34,0 +37,0 @@ "eslint-plugin-import": "^2.14.0",

# @everestate/serverless-router
> Dependency-free, minimalist, pluggable, universal router.
> Serverless, minimalist, pluggable, universal router.

@@ -15,3 +15,2 @@ ## Installation

* [serverless-router-web](https://github.com/everestate/serverless-router-web)
* [serverless-router-aws](https://github.com/everestate/serverless-router-aws)

@@ -24,3 +23,3 @@ * [serverless-router-dynamics](https://github.com/everestate/serverless-router-dynamics)

const Router = require('@everestate/serverless-router');
const Web = require('@everestate/serverless-router-web');
const { Http } = require('@everestate/serverless-router-aws');

@@ -30,5 +29,5 @@ cosnt userService = require('../services/userService');

function dispatch(event) {
const router = new Router([Web]);
const router = new Router([Http]);
router.web
router.http
.post('/users', () =>

@@ -35,0 +34,0 @@ userService.createUser(event.body)) // returns promise

Sorry, the diff of this file is not supported yet

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