https://github.com/devzgabriel/api-cepinspector
This is the CEP Inspector API repository. More information on how to access, install and test in the README
https://github.com/devzgabriel/api-cepinspector
jest jest-tests knex knexjs migrations node nodejs sqlite3 test typescript
Last synced: about 1 month ago
JSON representation
This is the CEP Inspector API repository. More information on how to access, install and test in the README
- Host: GitHub
- URL: https://github.com/devzgabriel/api-cepinspector
- Owner: devzgabriel
- License: mit
- Created: 2021-02-20T14:49:24.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-22T16:08:57.000Z (about 4 years ago)
- Last Synced: 2023-10-20T19:18:32.923Z (over 1 year ago)
- Topics: jest, jest-tests, knex, knexjs, migrations, node, nodejs, sqlite3, test, typescript
- Language: TypeScript
- Homepage:
- Size: 113 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# CEP Inspector
## Esse é o repositório da Api do CEP Inspector!
### Se quiser visitar o repositório do frontend é só clicar nesse link: [CEP Inspector](https://github.com/devzgabriel/CEP-Inspector)
## Rotas disponíveis
**Inspecionar CEP**
```HTTP
URL estará disponível em breve!
```### Enquanto não está disponivel pode usar um serviço alternativo ( [viaCep](https://viacep.com.br/) )
```HTTP
viacep.com.br/ws/{cep}/json/
```
## **Como executar na sua máquina e testar**
### **_Instalando e executando o projeto_**
No terminal digite todos os comandos abaixo:
```Bash
git clone https://github.com/devzgabriel/api-cepInspector.git
``````Bash
cd api-cepInspector
``````Bash
yarn install
``````Bash
yarn knex-migrate
``````Bash
yarn dev
```
### **Se seu objetivo é testar o frontend, isso é tudo que precisa faser! Mas se quer usar somente a API esses são os próximos passos:**
Para fazer requisições use a url abaixo e insira o número do CEP (sem traços) no lugar de "{cep}"
```HTTP
http://localhost:3333/inspect/{cep}
```O retorno será um JSON como exemplo abaixo:
```JSON
{
"id": 6,
"cep": "01310924",
"logradouro": "Avenida Paulista 1912",
"complemento": "",
"bairro": "Bela Vista",
"localidade": "São Paulo",
"uf": "SP",
"ibge": "3550308",
"gia": "1004",
"ddd": "11",
"siafi": "7107"
}
```### **_Executando testes_**
Os testes serão acrescentados em breve!
## **Criado por Gabriel Silva**