GithubHelp home page GithubHelp logo

yashtripathi01 / goroutine-api-go Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3 KB

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.

Go 100.00%

goroutine-api-go's Introduction

Go HTTP Server with Worker

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.

How it works

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.

Instructions to run

  1. Install Go: Make sure you have Go installed on your system. If not, download and install it from the official website.

  2. Clone the repository: Clone this repository to your local machine:

    git clone https://github.com/YashTripathi01/customerlabs-interview.git
  3. Navigate to project directory: Change directory to the project directory:

    cd customerlabs-interview
  4. Run the server: Execute the following command to run the Go program:

    go run main.go
  5. Access the server: Use an HTTP client like Postman or Insomnia to send JSON requests to the server endpoint and trigger the processing

  6. Send requests: Send JSON requests to the server endpoint (e.g., using cURL or Postman) to trigger the processing.

  7. Check output: The processed requests will be printed in the terminal where you ran the Go program.

Dependencies

This project uses only standard Go packages and does not require any additional dependencies.

Author

Yash Tripathi

goroutine-api-go's People

Watchers

Yash Tripathi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.