O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fetching a list of items

For fetching a list of items in the shopping cart, we will register the /restapi/get-cart-items endpoint:

r.Handle("/restapi/get-cart-items", endpoints.GetShoppingCartItemsEndpoint(env)).Methods("GET")

This endpoint will be handled by the GetShoppingCartItemsEndpoint handler function. This endpoint is responsible for encoding the shopping cart as JSON encoded data and providing it to the client-side application. Note that we use the HTTP GET method to call this endpoint.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required