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.
- 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.
To get started with Bun Microservice Gateways, follow these steps:
-
Clone the Repository:
git clone https://github.com/ratul3429/bun-microservice-gateways.git cd bun-microservice-gateways
-
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
-
Run the Gateway: Start the gateway using:
bun start
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"
}
]
}
- path: The URL path that the gateway will listen to.
- target: The URL of the internal microservice that will handle the request.
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.
We welcome contributions! If you would like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/YourFeature
- Make your changes and commit them:
git commit -m "Add your message here"
- Push to the branch:
git push origin feature/YourFeature
- Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For the latest updates and releases, visit the Releases section. You can download the latest version and execute it as needed.
To download a specific release, follow the link above, find the release you need, and download the appropriate file.
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.
Here are some resources to help you understand microservices and gateways better:
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!