BuildShipBBuildShip
Powered by
carpediemusC
BuildShip•3y ago•
8 replies
carpediemus

weatherapi problem

Trying to fetch weather data from weatherapi, the ai wrote me a code:


import fetch from 'node-fetch';
export default async function fetchWeatherForecast({
cityName,
apiKey
}) {
const url =
https://api.weatherapi.com/v1/forecast.json?key={apiKey}&q={cityName}&days=3
https://api.weatherapi.com/v1/forecast.json?key={apiKey}&q={cityName}&days=3
;
const response = await fetch(url);
const data = await response.json();
return data;
}


But i keep getting an error whenever i try to test the call.
Running the url with the api key in the browser returns the results without an issue.

{"error":{"message":"An error occurred while fetching: TypeError [ERR_INVALID_URL]: Invalid URL"},"label":"build node","message":"An error occurred while fetching: TypeError [ERR_INVALID_URL]: Invalid URL"}

I am just starting out with buildship so any help would be appreciated.
BuildShip banner
BuildShipJoin
Join founders, builders, devs using Low-code / No-code to create backend, APIs, scheduled Jobs, automation, AI workflows
7,971Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

FlutterFlow Buildship CORS Problem
WillyWWilly / ❓・buildship-help
10mo ago
Loop problem with supabase
Burak DönertaşBBurak Dönertaş / ❓・buildship-help
2y ago
Problem Streaming OpenAI Assistant
ArtusAArtus / ❓・buildship-help
2y ago
Problem with team project
vitoriaVvitoria / ❓・buildship-help
2y ago