0.0.3 • Published 8 years ago

loopback-hook-socket v0.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

LoopBack SocketHook

LoopBack.io component for connect to API over socket.io.

This component allow you to use models' methods over socket events such as HTTP-requests to LoopBack API.

All documented routes of API transform into socket events in the following format:

model:method

How to install

  1. Install npm package

    npm i loopback-hook-socket
  2. Add to server/component-config.json declaration of component

    {
      "loopback-hook-socket" : {}
    }
  3. View explorer of socket events

Configuration

OptionDescriptionTypeDefault
portport of Socket ServerNumber3030
enabledenabled\disabled componentBooleantrue
errorEventname of error eventStringerror
apiURILoopBack API URIStringhttp://127.0.0.1:3000/api
eventViewenabled\disabled explorer of socket eventsBooleantrue
mountPathmount path of explorer of socket eventsString/socket-hook-explorer

You could override default configuration parameters. Simply add this parameter to component's declaration in server/component-config.json.