Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/jordanoluz/goexpert-weather-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/jordanoluz/goexpert-weather-api

  • v0.0.0-20241121125931-48115bdffa9a
  • Source
  • Go
  • Socket score

Version published
Created
Source

Go Expert Weather API

This is a simple weather API project developed in Go that provides temperature information based on the postal code (zipcode), using Open Telemetry and Zipkin for tracing and spans.

How to Run the Project Locally

1. Clone the repository

Clone this repository to your local machine:

git clone https://github.com/jordanoluz/goexpert-weather-api.git

2. Navigate to the project directory

Change into the project directory:

cd goexpert-weather-api

3. Run Docker Compose

To run the project using Docker, use Docker Compose to build and start the containers:

docker compose up -d --build

This will build the Docker images and start the application containers.

4. Automated Tests

The Docker Compose setup will automatically run tests using the go test command before starting the application.

5. Test the API

Once the container is running, you can test the API using the following curl commands:

  • To check the POST request for a valid zipcode:
curl -X POST http://localhost:8181/weather \
     -H "Content-Type: application/json" \
     -d '{
         "cep": "29902555"
     }'

Expected response: City name and temperature data for the given zipcode.

6. Check the Tracing

After making the requests mentioned in step 5, you can access the following URL to view the tracing and span data:

http://localhost:9411

This will display the tracing results, allowing you to monitor the flow of requests through OpenTelemetry and Zipkin.

FAQs

Package last updated on 21 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc