module
Version:
v0.0.0-...-a998fd5
Opens a new window with list of versions in this module.
Published: Jun 27, 2021
License: MIT
Opens a new window with license information.
README
¶
go-api-gateway
This tool enables interaction between services by creating REST endpoints associated with pre-defined HTTP requests.
Getting Started
- Start server on http://localhost:8080:
go run cmd/server/main.go
- Create a REST API
myservice
:
curl \
--header "Content-Type: application/json" \
--request POST \
--data '{"name":"myservice"}' \
http://localhost:8080
- Create an API Endpoint
myservice/testEP
that makes a GET
request to httpbin.org/get:
curl \
--header "Content-Type: application/json" \
--request POST \
--data '{
"Name": "testEP",
"Description": "My EP",
"Request": {
"RequestVerb":"GET",
"RequestBody":"",
"RequestURL":"https://httpbin.org/get"
}
}' \
http://localhost:8080/myservice
- Execute the endpoint:
curl --request POST http://localhost:8080/myservice/testEP
Directories
¶
Click to show internal directories.
Click to hide internal directories.