This project demonstrates a simple Go HTTP server that receives JSON requests and processes them asynchronously using a worker goroutine. Each request is converted to a different format and sent to a webhook.
The Go HTTP server listens for incoming requests on port 8080. When a request is received, it decodes the JSON body into a struct, processes it asynchronously, and responds with an acknowledgment message.
The worker goroutine converts each incoming request into a different format, following the provided specifications. It then sends the converted request to a predefined webhook URL.
-
Install Go: Make sure you have Go installed on your system. If not, download and install it from the official website.
-
Clone the repository: Clone this repository to your local machine:
git clone https://github.com/YashTripathi01/customerlabs-interview.git
-
Navigate to project directory: Change directory to the project directory:
cd customerlabs-interview
-
Run the server: Execute the following command to run the Go program:
go run main.go
-
Access the server: Use an HTTP client like Postman or Insomnia to send JSON requests to the server endpoint and trigger the processing
-
Send requests: Send JSON requests to the server endpoint (e.g., using cURL or Postman) to trigger the processing.
-
Check output: The processed requests will be printed in the terminal where you ran the Go program.
This project uses only standard Go packages and does not require any additional dependencies.
Yash Tripathi