Skip to content

Instantly share code, notes, and snippets.

@sibinx7
Last active October 11, 2017 11:22
Show Gist options
  • Save sibinx7/2d059296f6a0a3e3debff2c843e65567 to your computer and use it in GitHub Desktop.
Save sibinx7/2d059296f6a0a3e3debff2c843e65567 to your computer and use it in GitHub Desktop.
Hapi JS Learning

Hapi Js Learning

Hapi JS is a node server framework like Express JS.

Introduction to Hapi JS

var Hapi = require('hapijs');
server = new Hapi.Server();

server.connection({ port: 9090, host: 'localhost'})

server.start((err)=>{
  if(err) console.log(err)
  console.log(/`Server is running @${server.info.url}`/)
})

Important Plugins

Social Media Authentication

Twitter Example Facebook Example

Rate Limiter

Example Patova

  • [Patova]
const rollbitIO = require('socket.io-client')(rollbitSocketURL);
rollbitIO.on('connect', () => {
  console.log('SOCKET 8080 CONNECTED')
});

rollbitIO.emit('login', userData, (response) => {
  callback(response)
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment