A simple Go API server that echoes back user input.
go run main.goThe server will start on http://localhost:8080
Accepts JSON input and returns it back.
Request:
{
"message": "Hello, World!"
}Response:
{
"echo": "Hello, World!"
}Health check endpoint that returns "OK".
curl -X POST http://localhost:8080/echo \
-H "Content-Type: application/json" \
-d '{"message": "Hello from the API!"}'