A user-friendly HTTP API & server for generating curl commands.
- Go 1.21 or later
- Clone the repository:
git clone https://github.com/alandavd/curlie.git- Install dependencies:
go mod tidy- Run the application:
go run cmd/api/main.go
go run cmd/server/main.goThe server will start on http://localhost:8080
- Run tests:
go test ./...Endpoint: POST /api/curl
Request Body:
{
"method": "POST",
"url": "https://api.example.com/data",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer token123"
},
"body": "{\"key\": \"value\"}",
"queryParams": {
"param1": "value1",
"param2": "value2"
}
}Response:
{
"command": "curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Bearer token123' -d '{\"key\": \"value\"}' 'https://api.example.com/data?param1=value1¶m2=value2'"
}The project follows hexagonal architecture:
internal/domain: Contains the core business logic and interfacesinternal/application: Contains the service implementationsinternal/infrastructure: Contains the HTTP handlers and server setup