Code Monkey home page Code Monkey logo

api-gateway's Introduction

api-gateway

Orchestrating Microservices for Seamless Integration

The api-gateway serves as a central orchestrator, seamlessly integrating key microservices:

  • Product Service: Manages product-related operations.
  • Auth Service: Handles user authentication and authorization.
  • Order Service: Orchestrates order-related activities.

Getting Started

1. Set Up Environment Variables

Create a .env file with the following configurations:

# Configuration for Product Service
PRODUCT_SERVICE_HOST=http://localhost:8080
LIST_PRODUCT_URI=/v1/products
CREATE_PRODUCT_URI=/v1/products
GET_PRODUCT_URI=/v1/products/:id
UPDATE_PRODUCT_URI=/v1/products/:id
DISABLE_PRODUCT_URI=/v1/products/:id/disable
ENABLE_PRODUCT_URI=/v1/products/:id/enable
INCREASE_BOOKED_QUOTA=/v1/products/increase-booked-quota
DECREASE_BOOKED_QUOTA=/v1/products/decrease-booked-quota

# Configuration for Auth Service
AUTH_SERVICE_HOST=http://localhost:8081
LOGIN_URI=/v1/login
LOGOUT_URI=/v1/logout
AUTHENTICATE_URI=/v1/authenticate

# Configuration for Order Service
ORDER_SERVICE_HOST=http://localhost:8082
ADD_TO_CART_URI=/v1/carts
CREATE_ORDER_URI=/v1/orders
CANCEL_ORDER_URI=/v1/orders/:id/cancel
LIST_ORDERS_URI=/v1/orders

2. Run the Application

Launch the application using the following command:

go run main.go

3. Access the Server

The server will be accessible at http://localhost:8000.

Contributing

We welcome contributions! Feel free to submit issues, feature requests, or pull requests.

License

This project is licensed under the MIT License.

api-gateway's People

Contributors

chandra-phang 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.