Skip to content

This repository provides a fast and configurable gateway using Bun, designed to route HTTP requests to your microservices efficiently. With features like smart routing and built-in health checks, it simplifies local development and lightweight setups. πŸ™πŸš€

License

Notifications You must be signed in to change notification settings

ratul3429/bun-microservice-gateways

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŒ€ Bun Microservice Gateways

GitHub Repo Size GitHub Stars GitHub Forks GitHub Issues

Welcome to the Bun Microservice Gateways repository! This project offers a fast and configurable gateway built with Bun. It is designed to forward HTTP requests to internal microservices based on path or prefix. This setup is ideal for lightweight environments and local development.

Table of Contents

Features

  • High Performance: Built with Bun, this gateway ensures blazing fast request handling.
  • Configurable: Easily set up routing based on paths or prefixes.
  • Lightweight: Perfect for local development and small setups.
  • Microservice Friendly: Seamlessly integrates with various microservices.

Getting Started

To get started with Bun Microservice Gateways, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/ratul3429/bun-microservice-gateways.git
    cd bun-microservice-gateways
  2. Install Dependencies: Ensure you have Bun installed. If you haven't installed Bun yet, follow the instructions on the official Bun website.

    Once Bun is installed, run:

    bun install
  3. Run the Gateway: Start the gateway using:

    bun start

Configuration

You can configure the gateway using a simple JSON file. Create a file named config.json in the root directory of your project. Here is an example configuration:

{
  "routes": [
    {
      "path": "/service1",
      "target": "http://localhost:3001"
    },
    {
      "path": "/service2",
      "target": "http://localhost:3002"
    }
  ]
}

Explanation

  • path: The URL path that the gateway will listen to.
  • target: The URL of the internal microservice that will handle the request.

Usage

Once you have configured your routes, you can start sending requests to your gateway. Here are some examples:

  • To send a request to Service 1:

    curl http://localhost:3000/service1
  • To send a request to Service 2:

    curl http://localhost:3000/service2

The gateway will forward these requests to the respective internal services based on the paths defined in your configuration.

Contributing

We welcome contributions! If you would like to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature/YourFeature
  3. Make your changes and commit them:
    git commit -m "Add your message here"
  4. Push to the branch:
    git push origin feature/YourFeature
  5. Create a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Releases

For the latest updates and releases, visit the Releases section. You can download the latest version and execute it as needed.

Example Release Download

To download a specific release, follow the link above, find the release you need, and download the appropriate file.

Topics

This repository covers a variety of topics related to microservices and gateways. Here are some relevant topics you might find interesting:

  • Microservices: A software architecture style that structures an application as a collection of loosely coupled services.
  • Gateway: A server that acts as an entry point to a microservice architecture, handling requests and routing them to the appropriate services.
  • JavaScript & TypeScript: The programming languages used to build this gateway.

Additional Resources

Here are some resources to help you understand microservices and gateways better:

Conclusion

Thank you for checking out Bun Microservice Gateways! We hope this project helps you in your development journey. If you have any questions or suggestions, feel free to open an issue or submit a pull request.

For the latest updates, remember to visit the Releases section regularly. Happy coding!

About

This repository provides a fast and configurable gateway using Bun, designed to route HTTP requests to your microservices efficiently. With features like smart routing and built-in health checks, it simplifies local development and lightweight setups. πŸ™πŸš€

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •