Skip to content

Commit 06338c6

Browse files
committed
add README.md
1 parent 6329450 commit 06338c6

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# GO Simple Gateway
2+
3+
GO Simple Gateway is a lightweight gateway application written in Go that acts as an intermediary between multiple APIs with different domains. It allows you to configure the endpoints and namespaces for each API through a YAML configuration file. This project utilizes the Go Fiber library for building fast and efficient HTTP APIs.
4+
5+
## Features
6+
7+
- Acts as a gateway for multiple APIs with different domains.
8+
- Configuration is stored in a YAML file.
9+
- Implements middleware for handling requests.
10+
- Supports various HTTP methods (GET, POST, PUT, PATCH, DELETE).
11+
- Easy to configure and extend.
12+
13+
## Prerequisites
14+
15+
- Go 1.16 or above
16+
- Go Fiber library (https://github.com/gofiber/fiber)
17+
18+
## Installation
19+
20+
1. Clone the repository:
21+
22+
```bash
23+
git clone https://github.com/your-username/go-simple-gateway.git
24+
25+
2. Change to the project directory:
26+
27+
```bash
28+
cd go-simple-gateway
29+
30+
3. Build the project:
31+
32+
```bash
33+
go build
34+
35+
4. Run the executable:
36+
37+
```bash
38+
./go-simple-gateway
39+
40+
The server will start running on http://localhost:8080.
41+
42+
## Configuration
43+
44+
The configuration for the gateway is stored in a YAML file named config.yml. Update this file according to your API endpoints and namespaces. Here's an example of the configuration file:
45+
46+
```yaml
47+
- endpoint: http://httpbin.org/
48+
namespace: httpbin
49+
```
50+
51+
In the above example, the gateway will forward requests with the /httpbin namespace to the http://httpbin.org/ endpoint.
52+
53+
## Usage
54+
55+
To access the APIs through the gateway, use the following URL format:
56+
57+
```bash
58+
http://localhost:8080/v1/{namespace}/{path}
59+
```
60+
61+
Replace `{namespace}` with the desired namespace from your configuration file and `{path}` with the specific path for the API endpoint.
62+
63+
## Middleware
64+
The gateway application includes a middleware that can be used for various purposes such as request logging, authentication, rate limiting, etc. Currently, the middleware is empty and can be customized according to your needs. Feel free to add your own logic and functionality to the middleware.
65+
66+
## Contributing
67+
Contributions are welcome! If you find any issues or want to add new features to the project, please open an issue or submit a pull request.
68+
69+
## License
70+
This project is licensed under the MIT License.
71+
72+
## Acknowledgments
73+
- [Go Fiber](https://gofiber.io/) A fast and efficient web framework for Go.
74+
75+
## Contact
76+
If you have any questions or suggestions, feel free to reach out to me at [me@dani.work](mailto://me@dani.work)
77+
78+
---
79+
Feel free to modify the README.md file according to your project's specific details and requirements. Provide instructions for setting up and running the application, describe the available features, and include any necessary guidelines for contributing to the project.

0 commit comments

Comments
 (0)