Skip to content

A realtime timeline built with HapiJS and Nes.

Notifications You must be signed in to change notification settings

feguedi/hapi-nes-mongo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hapi Nes Mongo

This is just an example of how to make a Hapi Webservice with its websockets module –Nes– and MongoDB.

Aim

This project it's inspired on the realtime timeline of Patrick Meier. It's an update to his tutorial to demonstrate how to utilize the Nes plugin to build a realtime project using websockets with Hapi, with the big difference that I decided to use MongoDB instead RethinkDB.

This is a short explanation on how to use websockets with Hapi, so that's why there's no use of a client-side framework (Angular, React, Vue, etc.).

There's a little bit of spanglish, specifically with the translation of "entry" as "entrada", just as a preview disclaimer.

Requirements

We can use an environment with Vagrant or a containter with Docker to host the database or use a database in the cloud (MongoDB Atlas).

Notes

The database only works with a replica set or a sharded cluster. MongoDB doesn't listen changes with a standalone instance.

Here is some information and tutorials that can be useful:

Scripts

Setting the environment variables

We need to copy the .env.example file, rename it as .env and put our own variables.

cp .env.example .env

Installing dependencies

npm install

Building the web bundle

npm run build

Start the service

npm start

Start the service as a developer

npm run dev

About

A realtime timeline built with HapiJS and Nes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages

  • JavaScript 82.1%
  • HTML 12.5%
  • CSS 4.9%
  • Shell 0.5%