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-20241114023421-5c657d2744f9
  • Source
  • Go
  • Socket score

Version published
Created
Source

Go Expert Weather API

This is a simple weather API project developed in Go, which provides temperature information based on the postal code (zipcode).

API URL

The API is published and available at the following URL:

Base URL: https://goexpert-weather-api-1036920645078.southamerica-east1.run.app/weather

You can use this base URL to test the API endpoints without needing to run the project locally.

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

cd goexpert-weather-api

3. Run Docker Compose

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

docker-compose up -d --build

This will build the Docker image and start the container with the application.

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 temperature for a valid zipcode:

curl "http://localhost:8080/weather?zipcode=93010001"

Expected response: Temperature data for the given zipcode.

  • To test an invalid zipcode:

curl "http://localhost:8080/weather?zipcode=1234"

Expected response: invalid zipcode.

  • To test a zipcode zipcode not found:

curl "http://localhost:8080/weather?zipcode=78654321"

Expected response: can not find zipcode.

FAQs

Package last updated on 14 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