Giter VIP home page Giter VIP logo

ms-gateway's Introduction

Gateway Microservice

This gateway connect the books microservice with authors microservice. It use OAuth2 security.

Instructions

  • Clone this repository
  • Install composer dependencies composer install
  • Copy .env.example in .env
  • Change database connection config
  • Execute php artisan migrate to run database migrations
  • You will need to create passport clients, so execute: php artisan passport:install and copy secret credentials
  • Set BOOKS_SERVICE_SECRET and AUTHORS_SERVICE_SECRET in .env with corresponding API KEYS generated for ms-authors and ms-books https://github.com/fedejuret/ms-books | https://github.com/fedejuret/ms-authors
  • Then run php -S localhost:8002 -t ./public

How to use

Now, you will need a HTTP Client, I recommend use Postman. Once that you have Postman, open it and send a POST request to: localhost:8002/oauth/token In the request body, you need to send theese params:

Param Value
grant_type client_credentials
client_id Generated client id when you ran: php artisan passport:install
client_secret Generated client secret when you ran: php artisan passport:install

This post request will return you an access_token. This access_token you will need to send it in all request that you will make

ms-gateway's People

Contributors

fedejuret 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.