Skip to content

API para consultas de CEP's. As consultas são realizadas através da ViaCep ou diretamente em cache.

Notifications You must be signed in to change notification settings

myllenacruz/zipcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zip Code Consult API

This application so far does not make connections with the database, therefore, the returned values are saved in memory or searched in ViaCep API. If this same zip code is searched within a period of up to 5 minutes, the data will be searched in cache and no longer in ViaCep.


Main frameworks, librarys and packages used:

Express - Provides a simple routing for requests made by clients.
Yarn - A fast, effective and secure package manager. But it's just my preference, you can use Pnpm or Npm as well.
Tsyringe - For dependency injection.
Axios - To communicate with ViaCep API.
JsonWebToken - For authentication.

Development

  1. Install project dependencies:
yarn install
  1. Start the server:
yarn dev

API Documentation

CURLs

  • You can make requests directly in Postman, importing the postman.json file. You find it in the directory: src/docs.
    • To make a zip code consult, you need to have your access token. To own an access token, follow the steps below:

      1 - Registrate ur user.

      2 - Do login and copy your accessToken.

      3 - Go to Zip Code Consult and paste your accessToken on Authorization > Type > Bearer Token. After this you ready to make your zip code consult.

Swagger

If your server is already up and you want a more practical and free way to test, access the swagger documentation: http://localhost:4000/docs.

Authentication is required to access

Credentials:

  • user: dev
  • password: @ZipCode2023#

About

API para consultas de CEP's. As consultas são realizadas através da ViaCep ou diretamente em cache.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages