Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/1 weather api #5

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open

Feat/1 weather api #5

wants to merge 31 commits into from

Conversation

fronzec
Copy link
Owner

@fronzec fronzec commented Feb 21, 2025

Weather API service

Solves this problem

Introduce `go.mod` file to define the module as `weather-service` and set Go version to 1.23. Include a basic `main.go` file with a sample program to print a greeting and iterate through a loop with calculations.
This commit introduces a .gitignore file to prevent tracking of binaries, logs, OS-generated files, and IDE-specific settings. It helps maintain a cleaner repository by excluding build outputs and dependency directories.
Created a README file introducing the Weather API Service. It includes a brief project description and a reference to the problem it solves.
Introduced an OpenAPI 3.0.0 specification with /ping and /weather endpoints, supporting basic application functionality. Expanded the README file to include a detailed project roadmap using a Gantt chart.
Replaced placeholder code with an HTTP server using net/http. Added a new /ping endpoint responding with an empty JSON object, and organized logic into a separate handlers package for better modularity. Logging was introduced to track server startup and errors.
This commit includes a basic `.air.toml` configuration file to enable live reloading for the development environment. It specifies build commands, file inclusion/exclusion rules, and other useful settings to streamline the development workflow using the Air tool.
Introduced a Taskfile.yml to streamline task execution. Added a "test" task for simple functionality testing and an "air" task to launch a development server on port 8080. This simplifies dev workflows.
This change ensures that temporary files located in the /tmp/ directory are excluded from version control. It helps prevent unnecessary clutter in the repository and avoids committing unintended files.
Introduced a new /weather route that responds with hardcoded weather data based on a required 'address' query parameter. Returns a JSON object with location, temperature, humidity, and condition, improving the API's functionality.
Create a new file `test.http` with sample requests to ping the server and fetch weather data by address. This helps in quick testing and debugging of API endpoints.
Introduce a `docker-compose.yml` file with a Redis service and update the Taskfile with environment setup and container management tasks. This improves local development workflows by providing consistent and reproducible environments.
Renamed `_devenvironment` to `_devenv` and adjusted file paths accordingly. Updated `Taskfile.yml` commands to reference the new directory and included `--project-name` for podman commands. These changes improve organization and clarity in the development setup.
Removed unnecessary `--port 808` option from the `air` command since it defaults to the correct value. This improves configuration clarity and reduces redundancy.
Added `http-client.private.env.json` to `.gitignore` for better environment configuration management. Extended `test.http` with new sample API requests, including a third-party weather service demonstration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant