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

@bracken/noodles

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bracken/noodles

> #### For Gitlab viewers : > Before your following steps to add this package as a npm depedency,you should set local npm registry first. > > ```bash > npm set registry http://npm.decobim.com > npm adduser --registry http://npm.decobim.com > ```

  • 1.6.5
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source
For Gitlab viewers :

Before your following steps to add this package as a npm depedency,you should set local npm registry first.

npm set registry http://npm.decobim.com
npm adduser --registry http://npm.decobim.com

Noodles

CocoaPods Hackage-Deps

A node middle layer for proxy, websocket, api polymerization and request side effects.

Demo usage in ./exec

Get Started

install as depedency with yarn

$ yarn add @decobim/noodles

Bootstrap noodles host server

const noodles = require("@decobim/noodles")

// noodles-sockets & noodles-redis are depedencies of noodles,
// you can require them directly
const sockets = require("@decobim/noodles-sockets");
const redises = require("@decobim/noodles-redis");

noodles(
  port: 9020,

  static: path.resolve(__dirname, "./public"),

  redis: {
    localhost: "redis://:@localhost/0"
  },

  proxy: {
    ops: {
      from: "/operation/v1",
      to: "http://dev.api.ops.decobim.com/v1/",
      hooks: {
        before: {
          "/identity/auth": function(req, res) {}
        },
        after: {
          "/identity/auth": function(req, res) {}
        }
      }
    },
    license: {
      from: "/license/v1",
      to: "http://dev.api.license.decobim.com/v1/"
    }
  },
  sockets: {
    channels: ["first", "second", "third"]
  },
  jwt: {
    authlessApi: [
      "/identity/auth",
      "/identity/project-quest-auth",
      "/identity/wechat-auth",
      "/admin/auth"
    ]
  }
})

Docs

configs.port

configs.static

optional

configs.redis

optional

redis config, each record will create a redis connection instance

format:

redis:{
  [name]:[redis address]
}

All instances can be accessed with redises[name]

const redises = require("noodles-redis")

redises[name].set("key","value")

redis instance properties:

PropertyDescriptionDemo
setset redis valueinstance.set(key:string,value:any)
getget valueinstance.get(key:string)
deldelele redis recordinstance.del(key:string)
onattach redis sub listenerinstance.on(channel:string,callback:func)

configs.proxy

optional

server proxy config, each record will create a a to b proxy mapping,and attach origin request method to noodles.clients.

format

proxy:{
 [name]:{
    from:[from path],
    to:[target url],
    hooks:{
      before:{
        [path]:callback
      },
      after:{
        [path]:callback
      }
    }
  }
}

proxy client properties

configs.sockets

optional

configs.sockets.channels

configs.jwt

optional

configs.jwt.authlessApi

Keywords

FAQs

Package last updated on 23 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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