Git Product home page Git Product logo

apigateway-playground's Introduction

API Gateway and Hypermedia

This repository is simply a set of 2 NodeJS applications that are exposing two services: Customers and Invoices for a presentation I'm going to have soon. Video links will be posted once ready.

The idea is to show the audience how REST and a good API Gateway are perfect tools to make your APIs really resilient and ready to change.

Express-Gateway is the API Gateway choosen here; basically because it's open source and really spread among the community; and I work on it as fulltime job. However any other else will do the job; you might want to check Kong as well.

Installation

Docker is used as a way to simulate different network topologies.

  1. Start the system

By using Kubernetes or whatever you like

  1. Insert some fixtures
curl -u t:t -X POST http://localhost/customers -H "Content-Type: application/json" -d '{"name":"Porcesco", "surname":"Gerbone"}'
curl -u t:t -X POST http://localhost/customers -H "Content-Type: application/json" -d '{"name":"Vincenzo", "surname":"Chianese"}'

Grab the returned ID and create some followup fake data

curl -u t:t -X POST http://localhost/customers/${customerId}/invoices -H "Content-Type: application/json" -d '{"date":"1507889426524", "amount":"150"}'
curl -u t:t -X POST http://localhost/customers/${customerId}/invoices -H "Content-Type: application/json" -d '{"date":"1507889426524", "amount":"200"}'

Alternative: node client.js and fill in your data directly

  1. Have fun.

Kubernetes

There's also a directory called kubernetes that contains a set of files to deploy the application and the dependencies in any Kubernetes cluster. In that case, instead of localhost, you might need to enter the IP address assigned by the cluster.

Comparing the changes

You can see the changes from monolith to hypermedia and viceversa using the following Github compare links:

apigateway-playground's People

Contributors

xvincentx avatar

Watchers

 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.