mayankdutta / API_Gateway

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API Documentation

This documentation provides details about the routes and endpoints exposed by the application.

Table of Contents


Authentication and Authorization

Check User Authentication

Endpoint: GET /bookingservice

Checks if the user is authenticated.

Response:

{
  "err": {},
  "message": "User is authenticated",
  "success": true,
  "data": "User is already successfully authenticated"
}

Check User Admin Status

Endpoint: GET /flightservice

Checks if the user is an admin.

Response:

{
  "err": {},
  "message": "User is admin",
  "success": true,
  "data": "User is already admin"
}

Booking Service

Proxy to Booking Service

Endpoint: Proxy /bookingservice

Proxies requests to the Booking Service at http://localhost:3002/.


Flight Service

Proxy to Flight Service

Endpoint: Proxy /flightService

Proxies requests to the Flight Service at http://localhost:3001/.


Other Routes

Home

Endpoint: GET /home

Returns a simple "ok" message.

Response:

{
  "message": "ok"
}

Other Services


Please note that this documentation provides information about the various routes and their purposes in the provided code. The routes related to checking authentication and authorization utilize middleware to ensure secure access. The proxy routes are used to forward requests to other services. Make sure to follow proper security practices and implement the necessary middleware, such as the AuthValidatorMiddleware and AdminValidatorMiddleware, to secure your application.

About


Languages

Language:JavaScript 100.0%