MCPcopy Create free account
hub / github.com/BrasilAPI/BrasilAPI / getCapitalWeather

Function getCapitalWeather

pages/api/cptec/v1/clima/capital/index.js:6–22  ·  view source on GitHub ↗
(request, response)

Source from the content-addressed store, hash-verified

4import { getCurrentCapitalWeatherData } from '@/services/cptec';
5
6async function getCapitalWeather(request, response) {
7 try {
8 const allCurrentConditionData = await getCurrentCapitalWeatherData();
9
10 return response.status(200).json(allCurrentConditionData);
11 } catch (err) {
12 if (err instanceof BaseError) {
13 throw err;
14 }
15
16 throw new InternalError({
17 message: 'Erro ao buscar informações sobre capitais',
18 type: 'city_error',
19 name: 'CAPITAL_INTERNAL',
20 });
21 }
22}
23
24export default app().get(getCapitalWeather);

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected