Giter Club home page Giter Club logo

gin-bookstore's Introduction

Bookstore REST API using Gin and Gorm - Running in your Kubernetes Cluster

Read the article.

Read the article.

STEPS to deploy in Kubernetes cluster

  1. Login to your cloud provider account and download kubeconfig of your cluster.

  2. Create a namespace - kubectl create namespace app

  3. Create a deployment - kubectl apply -f templates/deployment.yaml

  4. Create a service of type LoadBalancer - kubectl apply -f templates/service.yaml

  5. Get the LB service's external IP address using the command - kubectl get services -n app

  6. Interact with the bookstore application running in your Kubernetes cluster using REST APIs. Examples given below.

REST APIs

Create a Book : $ curl -vvv -X POST http://{{External-IP-Of-Service}}/books -H 'Content-Type: application/json' -d '{"title": "Start with Why","author": "Simon Sinek"}'

Get book details for book ID : $ curl -v http://{{External-IP-Of-Service}}/books/2

List all books : $ curl -vvv http://{{External-IP-Of-Service}}/books

Update a book's details by book ID : $ curl -vvv -X PATCH http://{{External-IP-Of-Service}}/books/2 -d '{"title":"Infinite Game"}'

Delete a book by book ID : $ curl -vvv -X DELETE http://{{External-IP-Of-Service}}/books/4

gin-bookstore's People

Contributors

rahmanfadhil avatar monkrus avatar kshamag avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.