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

Wfer 5 update home screen #143

Open
wants to merge 18 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
2 changes: 2 additions & 0 deletions NEW_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# this is the new readme file
- Add Some Content
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Front-end app
---
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 Expand Up @@ -96,3 +96,7 @@ make e2e
# Push

`GROUP=weaveworksdemos COMMIT=test ./scripts/push.sh`

this is new changes

some changes
8 changes: 7 additions & 1 deletion api/cart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,21 @@
// 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;
}

if (parseInt(req.body.quantity) > 100) {
throw new Error("Qantity cannot be greater than 100");
}

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