
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
github.com/jaswanth-gorripati/weather-api-server
This is a simple HTTP server written in Go that uses the OpenWeather API to fetch weather data based on latitude and longitude coordinates. The server exposes an endpoint that returns the weather condition and categorizes the temperature as cold, moderate, or hot.
Clone the repository:
git clone https://github.com/jaswanth-gorripati/weather-api-server.git
cd weather-api-server
Install dependencies:
This project requires Go to be installed. You can download and install it from here.
Build the server:
go build -o weather-server
You can provide the OpenWeather API key either through a command-line argument or an environment variable.
```sh
./weather-server -apikey YOUR_API_KEY
```
```sh
export OPENWEATHER_API_KEY=YOUR_API_KEY
./weather-server
```
The server will start on port 8080 by default. You can change the port by setting the PORT
environment variable.
To fetch weather data, make a GET request to the /weather
endpoint with lat
and lon
query parameters:
```sh
curl --location 'http://localhost:8080/weather?lat=78.37&lon=10.99'
```
```json
{
"temperature": "4.17°C",
"temperature_condition": "Cold",
"weather_condition": "Clouds"
}
```
FAQs
Unknown package
Did you know?
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.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.