A sample Pizzastore app backed by Pivotal Cloud Cache.
http://pcc-nodejs-app.xyz.com/pizzas
Lets Order Some Pizza
-------------------------------
types: plain, fancy
GET /orderPizza?email={emailId}&type={pizzaType} - Order a pizza
GET /orders?email={emailId} - get specific value
http://pcc-nodejs-app.xyz.com/[email protected]&type=fancy
Succesfully Placed Order For: [email protected]
http://pcc-nodejs-app.xyz.com/[email protected]
{
customer: "[email protected]",
order: {
type: "plain",
toppings: [
"cheese"
],
sauce: "red"
}
}
- Ubuntu 14.04
- NodeJS version: v8.12.0
- NPM Version: v6.4.1
- PCC Version: v1.4.0
- Pivotal GemFire: v9.3.0
- Pivotal GemFire Native Client Version: v9.2.1
-
Clone the git repo on Ubuntu workstation
git clone https://github.com/nchandrappa/pad-pcc-pizzastore-nodejs-app.git
-
Download the Pivotal GemFire Native Client v9.2.1 and extract the tar file into
/pad-pcc-pizzastore-nodejs-app/lib/https://network.pivotal.io/products/pivotal-gemfire/#/releases/163130
-
Set the following environment variables on ubuntu workstation
export GFCPP=<dir>/pad-pcc-pizzastore-nodejs-app/lib/pivotal-gemfire-native export PATH=$PATH:$GFCPP/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GFCPP/lib
-
Npm install dependencies required for PCC client
npm install node-pre-gyp --save npm install gemfire --save
Services can be created through Apps Manager Marketplace or by executing cf cli commands
cf marketplace p-cloudcache
cf create-service p-cloudcache extra-small pcc-dev-cluster
cf create-service-key workshop-pcc devkey
cf service-key workshop-pcc devkey
gfsh> connect --use-http=true --url=http://gemfire-xxxx-xxx-xx-xxxx.system.excelsiorcloud.com/gemfire/v1 --user=cluster_operator_xyz --password=*******
Note: Region name created on PCC server and client should match
gfsh> create region --name=pizza --type=PARTITION_REDUNDANT_PERSISTENT
---
applications:
- name: pcc-nodejs-app
memory: 512M
instances: 1
buildpack: nodejs_buildpack
command: scripts/start_nodefire.sh
timeout: 180
services:
- pcc-dev-cluster
cf push