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

Function action

pages/api/cvm/corretoras/v1/index.js:8–23  ·  view source on GitHub ↗
(request, response)

Source from the content-addressed store, hash-verified

6import { getExchangesData } from '../../../../../services/cvm/corretoras';
7
8const action = async (request, response) => {
9 try {
10 const allExchangesData = await getExchangesData();
11 return response.status(200).json(allExchangesData);
12 } catch (err) {
13 if (err instanceof BaseError) {
14 throw err;
15 }
16
17 throw new InternalError({
18 message: 'Erro ao buscar informações sobre corretora',
19 type: 'exchange_error',
20 name: 'EXCHANGE_INTERNAL',
21 });
22 }
23};
24
25export default app({ cache: 86400 }).get(action);

Callers

nothing calls this directly

Calls 1

getExchangesDataFunction · 0.90

Tested by

no test coverage detected