Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Test pr feature #145

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@
# Ignore coverage reports
/coverage

.idea
.idea

.DS_Store

newrelic_agent.log

agentlog.log
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM node:10-alpine
FROM node:12-alpine
ENV NODE_ENV "production"
ENV PORT 8079
EXPOSE 8079
ENV NEW_RELIC_NO_CONFIG_FILE=true
RUN addgroup mygroup && adduser -D -G mygroup myuser && mkdir -p /usr/src/app && chown -R myuser /usr/src/app

# Prepare app directory
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
[![Actions Status](https://github.com/microservices-demo/front-end/workflows/ci/badge.svg)](https://github.com/microservices-demo/front-end/workflows/ci/badge.svg)


Front-end app
Front-end app - test
---
Front-end application written in [Node.js](https://nodejs.org/en/) that puts together all of the microservices under [microservices-demo](https://github.com/microservices-demo/microservices-demo).
Front-end application written in [Node.js](https://nodejs.org/en/) that puts together all of the microservices under [microservices-demo](https://github.com/microservices-demo/microservices-demo)

# Build

Expand Down
4 changes: 3 additions & 1 deletion api/cart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,17 @@
// Update cart item
app.post("/cart/update", function (req, res, next) {
console.log("Attempting to update cart item: " + JSON.stringify(req.body));

if (req.body.id == null) {
next(new Error("Must pass id of item to update"), 400);
return;
}

if (req.body.quantity == null) {
next(new Error("Must pass quantity to update"), 400);
return;
}

var custId = helpers.getCustomerId(req, app.get("env"));

async.waterfall([
Expand Down
2 changes: 2 additions & 0 deletions helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
'use strict';

var request = require("request");
var newrelic = require("newrelic");
var helpers = {};

/* Public: errorHandler is a middleware that handles your errors
Expand All @@ -17,6 +18,7 @@
message: err.message,
error: err
};
newrelic.noticeError(err);
res.
status(err.status || 500).
send(ret);
Expand Down
Loading