Name: shipped-demo-cart
Owner: CiscoCloud
Description: Cart microservice for shopping site.
Created: 2016-04-01 18:03:31.0
Updated: 2018-05-08 09:52:19.0
Pushed: 2016-09-01 20:18:53.0
Homepage: null
Size: 471
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is a small Microservice example of simple Shopping Cart API endpoint to be used with Shipped.
go run cart.go
to start the server on localhost.curl -i http://localhost:8000
or view it on your web browsercted Result
/1.1 200 OK
: Tue, 19 Jan 2016 15:52:02 GMT
ent-Length: 160
ent-Type: text/html; charset=utf-8
l>
ead>
<title>An example layout</title>
head>
ody>
art is up and running.</p>
ry This command</p>
/p>
body>
ml>
or
|URL | HTTP Verb | Functionality |
|:—:|:—:|:—:|
|/v1/cart/
-H "Content-Type: application/json" -X POST http://localhost:8888/v1/cart/{item_id}
cted Result:
cess":true,
m":{item_id},
sage":"Added {name} to Cart"
-H "Content-Type: application/json" -X DELETE http://localhost:8888/v1/cart/{item_id}
cted Result:
cess":true,
m":{item_id},
sage":"Deleted {name} from Cart"
-H "Content-Type: application/json" -X POST -d '{"username":"nick"}' http://localhost:8888/v1/cart/
cted Result
t": [{
m_id": 1,
ntity": 1
-i -H "Content-Type: application/json" -X GET http://localhost:8888/v1/order/
cted Result
t": [{
m_id": 1,
ntity": 1
-i -H "Content-Type: application/json" -X POST -d '{"name":"nick","address":"example","card_number":0}' http://localhost:8001/v1/order/?mock=true
/1.1 202 Accepted
ent-Type: application/json
: Fri, 22 Jan 2016 17:56:52 GMT
ent-Length: 80
tus": "SUCCESS",
e": 202,
sage": "Order Info Saved!"
OR -H "Content-Type: application/json" -X POST -d @orderExamplePost.json http://localhost:8001/v1/order/?mock=true
tus": "SUCCESS",
e": 202,
sage": "Order Info Saved!"