Company Service with Express JS
Switch branches/tags
Nothing to show
Clone or download
Ricky Martaputra Ricky Martaputra
Ricky Martaputra and Ricky Martaputra add README.md
Latest commit 14d154d Aug 24, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin mocha chai POST PUT Aug 23, 2018
config update config from nconf to config.json Aug 23, 2018
helpers Initial commit Aug 17, 2018
middlewares update config from nconf to config.json Aug 23, 2018
models complete mocha and chai Aug 24, 2018
neo4j
public/stylesheets Initial commit Aug 17, 2018
routes add 401 to swagger Aug 24, 2018
test
views Initial commit Aug 17, 2018
.eslintrc.js
.gitignore Initial commit Aug 17, 2018
README.md add README.md Aug 24, 2018
app.js mocha chai POST PUT Aug 23, 2018
package-lock.json mocha chai POST PUT Aug 23, 2018
package.json mocha chai POST PUT Aug 23, 2018

README.md

Overview

This is a demo CRUD service by using NodeJS 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.