Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.