https://github.com/alwedo/echo
Echo serves ephemeral/mock endpoints created with parameters specified by clients.
https://github.com/alwedo/echo
api backend go golang http-server
Last synced: 6 months ago
JSON representation
Echo serves ephemeral/mock endpoints created with parameters specified by clients.
- Host: GitHub
- URL: https://github.com/alwedo/echo
- Owner: alwedo
- Created: 2024-11-11T17:38:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-12T13:35:18.000Z (over 1 year ago)
- Last Synced: 2025-12-16T04:37:49.173Z (7 months ago)
- Topics: api, backend, go, golang, http-server
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# echo
  [](https://goreportcard.com/report/github.com/Alvaroalonsobabbel/echo)
Echo serves ephemeral/mock endpoints created with parameters specified by clients and it's based on [these requirements](echo.md).
## Technical information
This application was built using Go, and the endpoints use [JSON:API v1.0](https://jsonapi.org/) as a format.
## Run locally
⚠️ This document assumes you know how to use git, the terminal and are comfortable around http calls.
1. [Install Go](https://go.dev/doc/install)
2. (optional) Run the tests with `make test`
3. (optional) Run the linter with `make lint` - you have to have [golangci-lint](https://golangci-lint.run/welcome/install/) installed.
4. Start the server with `make run`
Use cURL or Postman to send HTTP requests to the server at: `http://localhost:3000`
The Server works using the exact API documentation specified in the [requirements' examples](echo.md#examples).
To alleviate the burden of the tester, this implementation comes with an in-memory DB and four seeded endpoints.
## Quick cURL commands to test the server
View endpoints:
```bash
curl -L -X GET 'http://127.0.0.1:3000/endpoints'
```
Query an existing endpoint:
```bash
curl -L -X GET 'http://127.0.0.1:3000/revert_entropy'
```
Submit an endpoint:
```bash
curl -L -X POST 'http://127.0.0.1:3000/endpoints' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "endpoints",
"attributes": {
"verb": "GET",
"path": "/say_hi",
"response": {
"code": 200,
"headers": {"Content-Type":"text/plain"},
"body": "hi!"
}
}
}
}'
```
Now you can run View endpoints again to check the endpoint is there.
Use the endpoint:
```bash
curl -L -X GET 'http://127.0.0.1:3000/say_hi'
```