This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from "axios"; | |
const buscaCep = (cep) => { | |
// Lista de servidores, no qual a ordem é a prioridade | |
const servers = [ | |
`https://viacep.com.br/ws/${cep}/json`, | |
`https://ws.apicep.com/cep/${cep}.json`, | |
`https://brasilapi.com.br/api/cep/v1/${cep}` | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface IRedisRepository { | |
get(prefix: string, key: string): Promise<string | null>; | |
set(prefix: string, key: string, value: string): Promise<void>; | |
setHash(prefix: string, key: string, value: object): Promise<void>; | |
delete(prefix: string, key: string): Promise<void>; | |
} |