GithubHelp home page GithubHelp logo

adonis-websocket's Introduction

AdonisJs WebSocket

Version Build Status Coverage Status Downloads License

Gitter Trello Support AdonisJs


Adonis Websocket is the official **websockets** provider for AdonisJs. It lets you easily setup/authenticate channels and rooms with elegant syntax and power of ES2015 generators.:rocket:


Table of Contents


## Setup Follow the below instructions to setup this provider

Install

npm i --save adonis-websocket

Setting up the provider

All providers are registered inside bootstrap/app.js file.

const providers = [
  'adonis-websocket/providers/WsProvider'
]

Setting up the alias

Aliases makes it easier to reference a namespace with a short unique name. Aliases are also registered inside bootstrap/app.js file.

const aliases = {
  Ws: 'Adonis/Addons/Ws'
}

Setup process is done. Let's use the Ws provider now.


## Getting Started

Feel free to skip this section and read the official documentation, if you are on version 3.2 or later.

If you are using older version of adonis-app. You are supposed to create couple of directories in order to setup the ecosystem.

Bash Commands

Below are the bash commands to create required directories. Equivalent commands for windows can be used.

mkdir app/Ws
mkdir app/Ws/Controllers
touch app/Ws/socket.js

Loading socket.js file.

Next we need to do is loading the socket.js file when starting the server. Which will be inside bootstrap/http.js file. Paste the below line of code after use(Helpers.makeNameSpace('Http', 'routes'))

use(Helpers.makeNameSpace('Ws', 'socket'))

Next, read the official documentation ๐Ÿ“–


## Contribution Guidelines

In favor of active development we accept contributions from everyone. You can contribute by submitting a bug, creating pull requests or even improving documentation.

You can find a complete guide to be followed strictly before submitting your pull requests in the Official Documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.