mohamedGamalAbuGalala / expressjs-neo4j

Company Service with Express JS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

This is a demo CRUD service by using NodeJS and Neo4j (Please check this article https://www.ru-rocker.com/2018/08/28/how-to-make-a-simple-crud-example-using-expressjs-and-neo4j/).

REST

This demo is about creating, updating, retrieveng and deleting companies object via web service. The web service itself will be exposed as a REST service, following its standard:

  • POST: to create a company
  • PUT: to update a company
  • GET: to retrieve comapanies
  • DELETE: to remove companies Default path is http://localhost:3000.

NodeJS

For this purpose, I will use ExpressJS as a web application framework. As a basic setup, I use express generator. For authentication I use JWT mechanism, by using PassportJS And several supporting libraries such as swagger, morgan, lodash. Least, for connecting to Neo4j, I use official neo4j javascript driver neo4j-driver.

Dependencies

Here are the complete dependencies by far

   npm install morgan body-parser cors neo4j-driver method-override config.json lodash swagger-node-express swagger-jsdoc swagger-ui-express passport passport-jwt jsonwebtoken --save
   npm install eslint --save-dev

Run ESLINT

How to linter code

   ./node_modules/.bin/eslint --ext *.js

Testing

Testing dependencies

   npm install mocha chai chai-http --save-dev

Run your application

   npm start

Execute test

   npm test

Swagger

All the endpoint is documented through swagger, by accessing context path api-docs.

About

Company Service with Express JS


Languages

Language:JavaScript 98.6%Language:HTML 1.1%Language:CSS 0.4%