GithubHelp home page GithubHelp logo

swimlane / node-microservice-demo Goto Github PK

View Code? Open in Web Editor NEW
444.0 29.0 132.0 98 KB

✨ Example project for Micro-services w/ Node + TypeScript + Express + Swagger + Docker

TypeScript 93.27% JavaScript 3.75% Dockerfile 2.98%
nodejs microservices docker nginx

node-microservice-demo's Introduction

node-microservice-demo

⚠️ This project is not maintained any longer. Please feel free to fork it if you need to make changes to the library.

Code Climate Test Coverage Build Status codecov Codacy Badge

Example project for:

  • Micro-service APIs
  • Docker & Docker Compose
  • NGINX
  • Node 6.x
  • TypeScript 2.0
  • Express 4.0
  • Socket.io Websockets
  • PassportJS Auth
  • Swagger 2.0
  • Neo4j
  • MongoDB

Getting Started

Pre-reqs

Running

Install and start docker by docker-compose up.

Reads

node-microservice-demo's People

Contributors

amcdnl avatar brantw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-microservice-demo's Issues

Builds are failing

Hello I am trying to install and run it on my system using docker-compose up. It is failing with below error log. Do you have any idea what is the reason ?

ms_mongo    | {"t":{"$date":"2021-07-06T16:03:55.136+00:00"},"s":"I",  "c":"NETWORK",  "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
ms_petstore | 
ms_petstore | > [email protected] clean
ms_petstore | > npm-run-all -p clean:*
ms_petstore | 
ms_mongo    | {"t":{"$date":"2021-07-06T16:03:55.137+00:00"},"s":"I",  "c":"STORAGE",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":1,"port":27017,"dbPath":"/data/db","architecture":"64-bit","host":"09ad07a6261c"}}
ms_mongo    | {"t":{"$date":"2021-07-06T16:03:55.137+00:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.6","gitVersion":"72e66213c2c3eab37d9358d5e78ad7f5c1d0d0d7","openSSLVersion":"OpenSSL 1.1.1  11 Sep 2018","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu1804","distarch":"x86_64","target_arch":"x86_64"}}}}
ms_mongo    | {"t":{"$date":"2021-07-06T16:03:55.137+00:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"18.04"}}}
ms_mongo    | {"t":{"$date":"2021-07-06T16:03:55.137+00:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"*"}}}}
ms_mongo    | {"t":{"$date":"2021-07-06T16:03:55.143+00:00"},"s":"W",  "c":"STORAGE",  "id":22271,   "ctx":"initandlisten","msg":"Detected unclean shutdown - Lock file is not empty","attr":{"lockFile":"/data/db/mongod.lock"}}
ms_petstore | 
ms_petstore | > [email protected] clean:dist
ms_petstore | > rimraf dist
ms_petstore | 
ms_petstore | 
ms_petstore | > [email protected] clean:cov
ms_petstore | > rimraf coverage
ms_petstore | 
ms_mongo    | {"t":{"$date":"2021-07-06T16:03:55.147+00:00"},"s":"I",  "c":"STORAGE",  "id":22270,   "ctx":"initandlisten","msg":"Storage engine to use detected by data files","attr":{"dbpath":"/data/db","storageEngine":"wiredTiger"}}
ms_petstore | 
ms_petstore | > [email protected] build
ms_petstore | > npm-run-all -s build:ts build:swagger
ms_petstore | 
ms_mongo    | {"t":{"$date":"2021-07-06T16:03:55.151+00:00"},"s":"W",  "c":"STORAGE",  "id":22302,   "ctx":"initandlisten","msg":"Recovering data from the last clean checkpoint."}
ms_petstore | 
ms_petstore | > [email protected] build:ts
ms_petstore | > ./node_modules/typescript/bin/tsc
ms_petstore | 

ms_petstore | ERROR: "build:ts" exited with 127.
ms_nginx    | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
ms_petstore | ERROR: "build" exited with 1.
ms_nginx    | 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
ms_nginx    | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
ms_nginx    | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
ms_nginx    | /docker-entrypoint.sh: Configuration complete; ready for start up
ms_nginx    | 2021/07/06 16:04:06 [emerg] 1#1: host not found in upstream "users" in /etc/nginx/nginx.conf:22
ms_nginx    | nginx: [emerg] host not found in upstream "users" in /etc/nginx/nginx.conf:22
ms_neo4j    | 2021-07-06 16:04:08.226+0000 INFO  ======== Neo4j 4.3.2 ========
ms_nginx exited with code 1
ms_petstore exited with code 1

rimraf & npm-run-all

these dependencies aren't included in the package.json took me a bit to figure it out.

Not working

I'm on a mac. I have node 6.10.0. Here is the error message

`npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/nodemon/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.9.12-moby
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "-g" "nodemon" "node-inspector" "npm-run-all" "rimraf"
npm ERR! node v7.7.3
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the v8-debug package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs v8-debug
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls v8-debug
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /npm-debug.log
`

Response validation failed

Hi all,
I'm trying to use the pets project i got everything up an running however when I try to call:
http://localhost:8080/pets
I receive:

Error: Response validation failed: invalid content type (text/html).  These are valid: application/json
    at Object.module.exports.validateContentType (/Users/danielezurico/Downloads/node-microservice-demo-master/petstore/node_modules/swagger-tools/lib/validators.js:242:11)
    at ServerResponse.res.end (/Users/danielezurico/Downloads/node-microservice-demo-master/petstore/node_modules/swagger-tools/middleware/swagger-validator.js:202:20)
    at Array.write (/Users/danielezurico/Downloads/node-microservice-demo-master/petstore/node_modules/finalhandler/index.js:266:9)
    at listener (/Users/danielezurico/Downloads/node-microservice-demo-master/petstore/node_modules/on-finished/index.js:169:15)
    at onFinish (/Users/danielezurico/Downloads/node-microservice-demo-master/petstore/node_modules/on-finished/index.js:100:5)
    at callback (/Users/danielezurico/Downloads/node-microservice-demo-master/petstore/node_modules/ee-first/index.js:55:10)
    at IncomingMessage.onevent (/Users/danielezurico/Downloads/node-microservice-demo-master/petstore/node_modules/ee-first/index.js:93:5)
    at emitNone (events.js:86:13)
    at IncomingMessage.emit (events.js:186:7)
    at endReadableNT (_stream_readable.js:974:12)

any idea?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.