Switch branches/tags
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
api
controllers
repositories
services
test
Dockerfile
LICENSE
README.md
index.js
package.json

README.md

news feed micro-service in javascript

Overview

This is yet another implementation of the rudimentary news feed micro-service only this time implemented in node.js

You can learn more about this project by reading the following blogs; Node.js vs DropWizard and Python Flask vs Node.js.

Running the unit tests

sudo yum install nodejs npm --enablerepo=epel
npm install
npm test

Running the server

export MYSQL_HOST="127.0.0.1"
export MYSQL_USER="feed"
export MYSQL_PASS="feed"
export MYSQL_DB="feed"
export NOSQL_HOST="127.0.0.1"
export REDIS_HOST="127.0.0.1"
export SEARCH_HOST="127.0.0.1"
export SEARCH_PATH="/feed/stories"
npm start

Be advised that, at the time of this writing, I was not able to re ssh back in to the EC2 instance once I have installed node there.

To view the Swagger UI interface:

open http://localhost:8080/docs

Running the Docker image

sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo docker build -t feed .
sudo docker run -d --net=host --env-file ./env.list feed

Dependencies

This project uses swagger-tools which parses the swagger model at launch time to generate the RESTful interface programmatically.

This example uses the expressjs framework. To see how to make this your own, look here:

README

You can find the swagger assets used to generate the RESTful parts of this project here.

Here is the technology stack.

mysql is the relational database for participant and friend data.

redis is the external cache that fronts mysql.

cassandra is the nosql database for inbound and outbound feed data.

This technology is used in the unit tests.

mocha is the testing framework.

chai is the assertion library.

mockery is used to mock the repository code.