From 56bf43ad61f20e221868dd7e3124d9bd4c9399b2 Mon Sep 17 00:00:00 2001 From: d1g1t4ld1n4 Date: Wed, 28 Nov 2018 09:35:51 -0500 Subject: [PATCH 1/5] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index b300e0a..97f6609 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,10 @@ For example, you can add the following line to your shell’s rc file (e.g. ~/.b ```export PATH=/bin:$PATH``` Replace with the path to the extracted MongoDB archive. +## On Linux + +https://docs.mongodb.com/manual/administration/install-on-linux/ + ## Stackle API 1. `cd` in to the **stackle_api** directory. 2. Run `npm install` to install the packages required. From b69b3ab2a7dcfb655f26ee0a1d1f72766d8c659e Mon Sep 17 00:00:00 2001 From: d1g1t4ld1n4 Date: Wed, 28 Nov 2018 10:00:13 -0500 Subject: [PATCH 2/5] Add mongoDB installation instructions for linux --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 97f6609..95c240f 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ For example, you can add the following line to your shell’s rc file (e.g. ~/.b Replace with the path to the extracted MongoDB archive. ## On Linux +For Ubuntu,SUSE, and Debian systems, you can install mongoDB Community Edition using .deb packages. The process varies from distro to distro, so I suggest you visit the link below, select your distribution. https://docs.mongodb.com/manual/administration/install-on-linux/ From deb1aefc8bc999e93edd99eac18d490ca35637d2 Mon Sep 17 00:00:00 2001 From: d1g1t4ld1n4 Date: Wed, 28 Nov 2018 12:39:04 -0500 Subject: [PATCH 3/5] Add terminal commands to mentioned distros --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 95c240f..e648630 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,15 @@ Replace with the path to the extracted MongoDB archi ## On Linux For Ubuntu,SUSE, and Debian systems, you can install mongoDB Community Edition using .deb packages. The process varies from distro to distro, so I suggest you visit the link below, select your distribution. +Ubuntu terminal command: +`sudo apt-get update +sudo apt-get install -y mongodb-org` +Debian terminal command: +`sudo apt-get update +sudo apt-get install -y mongodb-org` +SUSE terminal command: +`sudo zypper -n install mongodb-org` + https://docs.mongodb.com/manual/administration/install-on-linux/ ## Stackle API From 43531a7f6db50bab8f0fb01cacb631eb29202095 Mon Sep 17 00:00:00 2001 From: Kartik Pandey Date: Sat, 29 Dec 2018 17:03:51 +0530 Subject: [PATCH 4/5] fix #153, fix #154 --- stackle_api/app/lib/validator.js | 127 ++++++++++++++++--------------- 1 file changed, 64 insertions(+), 63 deletions(-) diff --git a/stackle_api/app/lib/validator.js b/stackle_api/app/lib/validator.js index 1685f99..d815cac 100644 --- a/stackle_api/app/lib/validator.js +++ b/stackle_api/app/lib/validator.js @@ -4,6 +4,7 @@ */ function Validator(input) { this.input = input; + this.inputObjKeys = Object.keys(input) }; @@ -12,39 +13,39 @@ Validator.prototype.validateAddingPost = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('title')) { + if (!this.input.title) { throw new Error('Attribute title is missing'); } - if (!!!~Object.keys(this.input).indexOf('description')) { + if (!this.input.description) { throw new Error('Attribute description is missing'); } - if (!!!~Object.keys(this.input).indexOf('repository')) { + if (!this.input.repository) { throw new Error('Attribute repository is missing'); } - if (!!!~Object.keys(this.input).indexOf('org_name')) { + if (!this.input.org_name) { throw new Error('Attribute org_name is missing'); } - if (!!!~Object.keys(this.input).indexOf('tags')) { + if (!this.input.tags) { throw new Error('Attribute tags is missing'); } - if (!!!~Object.keys(this.input).indexOf('linkIssue')) { + if (!this.input.linkIssue) { throw new Error('Attribute link_issue is missing'); } - if (!!!~Object.keys(this.input).indexOf('user')) { + if (!this.input.user) { throw new Error('Attribute user is missing'); } - if (!!!~Object.keys(this.input).indexOf('date')) { + if (!this.input.date) { throw new Error('Attribute date is missing'); } @@ -57,11 +58,11 @@ Validator.prototype.validateGetPost = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('postId')) { + if (!this.input.postId) { throw new Error('Attribute postId is missing'); } @@ -74,11 +75,11 @@ Validator.prototype.validateUserId = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('userId')) { + if (!this.input.userId) { throw new Error('Attribute userId is missing'); } @@ -91,11 +92,11 @@ Validator.prototype.validateDeletePost = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('postId')) { + if (!this.input.postId) { throw new Error('Attribute postId is missing'); } @@ -107,11 +108,11 @@ Validator.prototype.validatePostsByUser = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('user')) { + if (!this.input.user) { throw new Error('Attribute user is missing'); } @@ -123,11 +124,11 @@ Validator.prototype.validatePostToOrganisation = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('organisationName')) { + if (!this.input.organisationName) { throw new Error('Attribute organisationName is missing'); } @@ -139,11 +140,11 @@ Validator.prototype.validateGetOrganisationDetails = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('organisationName')) { + if (!this.input.organisationName) { throw new Error('Attribute organisationName is missing'); } @@ -156,11 +157,11 @@ Validator.prototype.validateStackId = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('stackId')) { + if (!this.input.stackId) { throw new Error('Attribute stackId is missing'); } @@ -173,11 +174,11 @@ Validator.prototype.validateCommentsByUser = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('user')) { + if (!this.input.user) { throw new Error('Attribute user is missing'); } @@ -190,11 +191,11 @@ Validator.prototype.validateCommentOnPost = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('postId')) { + if (!this.input.postId) { throw new Error('Attribute postId is missing'); } @@ -207,19 +208,19 @@ Validator.prototype.validateCommentBody = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('description')) { + if (!this.input.description) { throw new Error('Attribute description is missing'); } - if (!!!~Object.keys(this.input).indexOf('user')) { + if (!this.input.user) { throw new Error('Attribute user is missing'); } - if (!!!~Object.keys(this.input).indexOf('date')) { + if (!this.input.date) { throw new Error('Attribute date is missing'); } @@ -232,11 +233,11 @@ Validator.prototype.validateCommentId = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('commentId')) { + if (!this.input.commentId) { throw new Error('Attribute commentId is missing'); } @@ -249,11 +250,11 @@ Validator.prototype.validatePostId = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('postId')) { + if (!this.input.postId) { throw new Error('Attribute postId is missing'); } @@ -265,11 +266,11 @@ Validator.prototype.validateAddTag = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('tag')) { + if (!this.input.tag) { throw new Error('Attribute tag is missing'); } @@ -281,25 +282,25 @@ Validator.prototype.validateCreateStack = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('name')) { + if (!this.input.name) { throw new Error('Attribute name is missing'); } - if (!!!~Object.keys(this.input).indexOf('description')) { + if (!this.input.description) { throw new Error('Attribute description is missing'); } - if (!!!~Object.keys(this.input).indexOf('stackleUrl')) { + if (!this.input.stackleUrl) { throw new Error('Attribute stackleUrl is missing'); } - // if (!!!~Object.keys(this.input).indexOf('githubUrl')) { throw new Error('Attribute githubUrl is missing'); } + // if (!!!~this.inputObjKeys.indexOf('githubUrl')) { throw new Error('Attribute githubUrl is missing'); } - if (!!!~Object.keys(this.input).indexOf('createdUser')) { + if (!this.input.createdUser) { throw new Error('Attribute createdUser is missing'); } @@ -311,11 +312,11 @@ Validator.prototype.validateDeleteStack = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('stackId')) { + if (!this.input.stackId) { throw new Error('Attribute stackId is missing'); } @@ -327,15 +328,15 @@ Validator.prototype.validateUserSubscribeStack = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('stackId')) { + if (!!!~this.inputObjKeys.indexOf('stackId')) { throw new Error('Attribute stackId is missing'); } - if (!!!~Object.keys(this.input).indexOf('userId')) { + if (!this.input.userId) { throw new Error('Attribute userId is missing'); } @@ -348,11 +349,11 @@ Validator.prototype.validateGetUserSubscribeStack = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('userId')) { + if (!this.input.userId) { throw new Error('Attribute userId is missing'); } @@ -364,23 +365,23 @@ Validator.prototype.validateCreateNewUser = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('token')) { + if (!this.input.token) { throw new Error('Attribute token is missing'); } - if (!!!~Object.keys(this.input).indexOf('userId')) { + if (!this.input.userId) { throw new Error('Attribute userId is missing'); } - if (!!!~Object.keys(this.input).indexOf('email')) { + if (!this.input.email) { throw new Error('Attribute email is missing'); } - if (!!!~Object.keys(this.input).indexOf('name')) { + if (!this.input.name) { throw new Error('Attribute name is missing'); } @@ -395,19 +396,19 @@ Validator.prototype.validateReplyBody = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('description')) { + if (!this.input.description) { throw new Error('Attribute description is missing'); } - if (!!!~Object.keys(this.input).indexOf('user')) { + if (!this.input.user) { throw new Error('Attribute user is missing'); } - if (!!!~Object.keys(this.input).indexOf('date')) { + if (!this.input.date) { throw new Error('Attribute date is missing'); } @@ -421,11 +422,11 @@ Validator.prototype.validateRepliesByUser = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('user')) { + if (!this.input.user) { throw new Error('Attribute user is missing'); } @@ -438,11 +439,11 @@ Validator.prototype.validateReplyId = function() { throw new Error('Input is undefined'); } - if (!Object.keys(this.input).length) { + if (!this.inputObjKeys.length) { throw new Error('Empty Object has been passed'); } - if (!!!~Object.keys(this.input).indexOf('replyId')) { + if (!this.input.replyId) { throw new Error('Attribute replyId is missing'); } From 95be979850abd0c3fe9dee1f73a5a1e7df32ea67 Mon Sep 17 00:00:00 2001 From: kmehant Date: Tue, 25 Jun 2019 08:53:51 +0530 Subject: [PATCH 5/5] Added restart capability to database --- docker-compose.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index d9ed26b..410315a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,11 +4,13 @@ services: build: './stackle_api' ports: - "8080:8080" - links : + links: - mongo mongo: - image : mongo + image: mongo + restart: unless-stopped + angular: - build : './stackle_app' - ports : - - "9000:9000" \ No newline at end of file + build: './stackle_app' + ports: + - "9000:9000"