Skip to content

Instantly share code, notes, and snippets.

View WygorFonseca's full-sized avatar
🐈
Teaching my cat how to code

Wygor Fonseca WygorFonseca

🐈
Teaching my cat how to code
View GitHub Profile
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}`
];
@WygorFonseca
WygorFonseca / IRedisRepository.ts
Last active February 26, 2024 17:35
Redis client factory e redis repository para NESTJS
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>;
}