diff --git a/.circleci/config.yml b/.circleci/config.yml
index eb2d0ec..65059ab 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -9,6 +9,7 @@ workflows:
only:
- main
- dev
+ - rollback
jobs:
build_docker_image:
diff --git a/package.json b/package.json
index bc8fdf6..d371a37 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
- "dev": "next dev",
+ "dev": "next dev -p 8080",
"build": "next build",
"start": "next start",
"lint": "next lint"
diff --git a/src/components/cepResult/cepResult.tsx b/src/components/cepResult/cepResult.tsx
index c4effcf..26c6eb8 100644
--- a/src/components/cepResult/cepResult.tsx
+++ b/src/components/cepResult/cepResult.tsx
@@ -16,6 +16,7 @@ interface propsCepResult {
estado: string;
latitude: number;
longitude: number;
+ tipoLogradouro: string;
}
export const CepResult: FunctionComponent
- Logradouro: {logradouro} + Logradouro: {`${tipoLogradouro} ${logradouro}`}
Bairro: {bairro}
diff --git a/src/pages/cep/[...cep].tsx b/src/pages/cep/[...cep].tsx
index 27099b5..b8401cb 100644
--- a/src/pages/cep/[...cep].tsx
+++ b/src/pages/cep/[...cep].tsx
@@ -18,7 +18,17 @@ export const getServerSideProps: GetServerSideProps = async (context: any) => {
};
}
- const response = await fetch(`${process.env.API_LINK}/cep/${cep}`);
+ const credentials = `${process.env.CLIENT_ID}:${process.env.CLIENT_SECRET}`;
+ const base64Credentials = btoa(credentials);
+
+ const response = await fetch(`${process.env.API_LINK}/cep/${cep}`, {
+ headers: {
+ Authorization: `Basic ${base64Credentials}`,
+ },
+ next: {
+ revalidate: 2592000,
+ },
+ });
const post = await response.json();
return {
@@ -38,9 +48,19 @@ const CepPage: FunctionComponent