Skip to content

A user-friendly HTTP API & server for generating curl commands.

Notifications You must be signed in to change notification settings

AlanDavd/Curlie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Curlie

A user-friendly HTTP API & server for generating curl commands.

Getting Started

Prerequisites

  • Go 1.21 or later

Installation

  1. Clone the repository:
git clone https://github.com/alandavd/curlie.git
  1. Install dependencies:
go mod tidy
  1. Run the application:
go run cmd/api/main.go

go run cmd/server/main.go

The server will start on http://localhost:8080

  1. Run tests:
go test ./...

API Usage

Generate Curl Command

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&param2=value2'"
}

Project Structure

The project follows hexagonal architecture:

  • internal/domain: Contains the core business logic and interfaces
  • internal/application: Contains the service implementations
  • internal/infrastructure: Contains the HTTP handlers and server setup

About

A user-friendly HTTP API & server for generating curl commands.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published