* `{
"name": "Welcome to the world of CakePHP",
"description": "Learn how to build web applications with CakePHP",
"author": "CakePHP"
}`
- [**Introduction:**](#introduction)
- [**Table of Contents:**](#table-of-contents)
- [**Prerequisites:**](#prerequisites)
- [**What is CakePHP?:**](#what-is-cakephp)
- [**Why use CakePHP?:**](#why-use-cakephp)
- [**Installing and Setting up:**](#installing-and-setting-up)
- [**Installing a local development environment:**](#installing-a-local-development-environment)
- [**Setting up the CakePHP framework:**](#setting-up-the-cakephp-framework)
- [**Starting a new application:**](#starting-a-new-application)
- [**Chapter 1: Building your first CakePHP application:**](#chapter-one-building-your-first-cakephp-application)
- [**Setting up the database:**](#setting-up-the-database)
- [**Creating a new controller:**](#creating-a-new-controller)
- [**Creating a new model:**](#creating-a-new-model)
- [**Creating a new view:**](#creating-a-new-view)
- [**Testing the application:**](#testing-the-application)
- [**Chapter 2: Understanding CakePHP models:**](#chapter-two-understanding-cakephp-models)
- [**Introduction to models:**](#introduction-to-models)
- [**Creating models in CakePHP:**](#creating-models-in-cakephp)
- [**Defining a model:**](#defining-a-model)
- [**Inheritance in models:**](#inheritance-in-models)
- [**Data access in CakePHP:**](#data-access-in-cakephp)
- [**Querying data with Active Record:**](#querying-data-with-active-record)
- [**Pagination in CakePHP:**](#pagination-in-cakephp)
- [**Validation in models:**](#validation-in-models)
- [**Basic validation:**](#basic-validation)
- [**Custom validation rules:**](#custom-validation-rules)
- [**Chapter 3: Understanding CakePHP views:**](#chapter-three-understanding-cakephp-views)
- [**Introduction to views:**](#introduction-to-views)
- [**Creating views in CakePHP:**](#creating-views-in-cakephp)
- [**Defining a view:**](#defining-a-view)
- [**View inheritance in CakePHP:**](#view-inheritance-in-cakephp)
- [**Layouts in CakePHP views:**](#layouts-in-cakephp-views)
- [**Defining a layout:**](#defining-a-layout)
- [**Layout inheritance in CakePHP views:**](#layout-inheritance-in-cakephp-views)
- [**Passing data to views:**](#passing-data-to-views)
- [**Using variables in views:**](#using-variables-in-views)
- [**Using helpers in views:**](#using-helpers-in-views)
- [**Chapter 4: Understanding CakePHP controllers:**](#chapter-four-understanding-cakephp-controllers)
- [**Introduction to controllers:**](#introduction-to-controllers)
- [**Creating controllers in CakePHP:**](#creating-controllers-in-cakephp)
- [**Defining a controller:**](#defining-a-controller)
- [**Action inheritance in controllers:**](#action-inheritance-in-controllers)
- [**Routing in CakePHP controllers:**](#routing-in-cakephp-controllers)
- [**Defining routes:**](#defining-routes)
- [**Route inheritance in CakePHP controllers:**](#route-inheritance-in-cakephp-controllers)
- [**Ajax support in controllers:**](#ajax-support-in-controllers)
- [**Defining Ajax actions:**](#defining-ajax-actions)
- [**Using Ajax with CakePHP controllers:**](#using-ajax-with-cakephp-controllers)
- [**Chapter 5: Understanding CakePHP routing:**](#chapter-five-understanding-cakephp-routing)
- [**Introduction to routing:**](#introduction-to-routing)
- [**Routing in CakePHP controllers:**](#routing-in-cakephp-controllers)
- [**Defining routes:**](#defining-routes)
- [**Route inheritance in CakePHP controllers:**](#route-inheritance-in-cakephp-controllers)
- [**Routing in CakePHP views:**](#routing-in-cakephp-views)
- [**Defining links:**](#defining-links)
- [**Link inheritance in CakePHP views:**](#link-inheritance-in-cakephp-views)
- [**Custom routing in CakePHP:**](#custom-routing-in-cakephp)
- [**Defining custom routes:**](#defining-custom-routes)
- [**Using custom routes with controllers:**](#using-custom-routes-with-controllers)
- [**Chapter 6: Understanding CakePHP helpers:**](#chapter-six-understanding-cakephp-helpers)
- [**Introduction to helpers:**](#introduction-to-helpers)
- [**Creating helpers in CakePHP:**](#creating-helpers-in-cakephp)
- [**Defining a helper:**](#defining-a-helper)
- [**Helper inheritance in CakePHP:**](#helper-inheritance-in-cakephp)
- [**Using helpers in controllers:**](#using-helpers-in-controllers)
- [**Defining helper methods:**](#defining-helper-methods)
- [**Using helper methods in controllers:**](#using-helper-methods-in-controllers)
- [**Using helpers in views:**](#using-helpers-in-views)
- [**Defining helper functions:**](#defining-helper-functions)
- [**Using helper functions in views:**](#using-helper-functions-in-views)
- [**Chapter 7: Understanding CakePHP session management:**](#chapter-seven-understanding-cakephp-session-management)
- [**Introduction to session management:**](#introduction-to-session-management)
- [**Session management in CakePHP controllers:**](#session-management-in-cakephp-controllers)
- [**Starting a session:**](#starting-a-session)
- [**Maintaining sessions in CakePHP:**](#maintaining-sessions-in-cakephp)
- [**Session management in CakePHP views:**](#session-management-in-cakephp-views)
- [**Defining session variables:**](#defining-session-variables)
- [**Using session variables in views:**](#using-session-variables-in-views)
- [**Logging out users in CakePHP:**](#logging-out-users-in-cakephp)
- [**Defining a logout method:**](#defining-a-logout-method)
- [**Using the logout method in controllers:**](#using-the-logout-method-in-controllers)
- [**Chapter 8: Understanding CakePHP email:**](#chapter-eight-understanding-cakephp-email)
- [**Introduction to email in CakePHP:**](#introduction-to-email-in-cakephp)
- [**Email configuration in CakePHP:**](#email-configuration-in-cakephp)
- [**Defining email settings:**](#defining-email-settings)
- [**Using email settings in controllers:**](#using-email-settings-in-controllers)
- [**Sending emails in CakePHP views:**](#sending-emails-in-cakephp-views)
- [**Defining email templates:**](#defining-email-templates)
- [**Using email templates in views:**](#using-email-templates-in-views)
- [**Using attachments with emails in CakePHP:**](#using-attachments-with-emails-in-cakephp)
- [**Defining email attachments:**](#defining-email-attachments)
- [**Using email attachments in views:**](#using-email-attachments-in-views)
- [**Chapter 9: Understanding CakePHP authentication:**](#chapter-nine-understanding-cakephp-authentication)
- [**Introduction to authentication in CakePHP:**](#introduction-to-authentication-in-cakephp)
- [**Authentication in CakePHP controllers:**](#authentication-in-cakephp-controllers)
- [**Defining user models:**](#defining-user-models)
- [**Authenticating users in CakePHP:**](#authenticating-users-in-cakephp)
- [**Authentication in CakePHP views:**](#authentication-in-cakephp-views)
- [**Defining login forms:**](#defining-login-forms)
- [**Using login forms in views:**](#using-login-forms-in-views)
- [**Password resetting in CakePHP:**](#password-resetting-in-cakephp)
- [**Defining password reset functionality:**](#defining-password-reset-functionality)
- [**Using password reset functionality in views:**](#using-password-reset-functionality-in-views)
- [**Chapter 10: Understanding CakePHP internationalization:**](#chapter-ten-understanding-cakephp-internationalization)
- [**Introduction to internationalization in CakePHP:**](#introduction-to-internationalization-in-cakephp)
- [**Language configuration in CakePHP:**](#language-configuration-in-cakephp)
- [**Defining language settings:**](#defining-language-settings)
- [**Using language settings in controllers:**](#using-language-settings-in-controllers)
- [**Language configuration in CakePHP views:**](#language-configuration-in-cakephp-views)
- [**Defining language files:**](#defining-language-files)
- [**Using language files in views:**](#using-language-files-in-views)
- [**Localization support in CakePHP:**](#localization-support-in-cakephp)
- [**Defining localized content:**](#defining-localized-content)
- [**Using localized content in views:**](#using-localized-content-in-views)
- **Conclusion**
The first time I saw a magician, I was amazed. He could make things disappear with just a wave of his hand. He could conjure up objects from thin air and make them float in mid-air. I couldn't believe my eyes!
As I grew older, I became more interested in magic. I started reading books about magicians and their tricks. I even tried some of the simpler ones myself, but I couldn't seem to pull off the really impressive feats.
One day, I decided to take a class in magic. The teacher was an experienced magician who had been performing for years. He taught us all sorts of different techniques and tricks, and he even showed us some of his own routines.
It was hard work, but after a few weeks of practice, I started to see improvements. I could make coins disappear with more confidence, and I even learned how to levitate small objects.
Eventually, I felt ready to perform my own magic show. I practiced for weeks, perfecting my routine and making sure everything flowed smoothly. And on the day of the performance, I was nervous but excited.
As I walked onto the stage, the audience started clapping. And when I finished my final trick, they erupted into cheers and applause. It was one of the most exhilarating experiences of my life!
From that moment on, I knew that magic would always be a part of me. It's a skill that requires practice and dedication, but it's also a lot of fun. And who knows, maybe one day I'll be performing for thousands of people like the magicians I saw as a child.
# How to use a Docker Hub repository as a source for `git clone`?
I have a GitHub account (which I'll call *my_github*) and a repository, which I'll call *my_repo*.
**My question is:** if I want to use my_github as a source for `git clone`, how do I specify it in the command?
For example, if I wanted to clone my repo from GitHub using the following command:
```
git clone https://github.com/my_github/my_repo.git
```
How would I change the URL?
Comment: Does this answer your question? [Cloning Docker Hub Repository](https://stackoverflow.com/questions/27541975/cloning-docker-hub-repository)
## Answer (18)
You can clone a DockerHub repository by simply using the `git clone` command with the URL as you would for any other repository. For example:
```
$ git clone https://hub.docker.com/v2/repositories/library/ubuntu:latest
```
This will download the Ubuntu image from DockerHub and place it in a new directory called `ubuntu` with subdirectories for each of the images available on DockerHub.
If you are using `docker pull`, you can specify the repository owner and name with the `repository:tag` syntax, like this:
```
$ docker pull myuser/myrepo:latest
```
Comment: This answer is incorrect. The question asks about using a git repo. There's no git in Dockerhub, it's just a registry for container images, so there isn't really anything to clone (or pull from). You can't use docker hub as source for `git clone`, because you have to have a GitHub repository.
Comment: @jamesd That's not true. You can clone the DockerHub repository with git clone and pull images from it with docker pull. The link in my answer is an example of how to do it.
## Answer (1)
For anyone interested, here is how you can use a Docker Hub repo as a source for `git clone`:
1. Go to your repository on GitHub
2. In the URL bar, click the "Code" button and select "HTTPS". This will provide you with a link in the following format: https://github.com/my_github/my_repo.git
3. Replace the last part of the URL, `.git` with `-master.tar.gz`. For example: https://github.com/my_github/my_repo-master.tar.gz
4. Open a terminal and run the following command: `docker pull my_github/my_repo-master.tar.gz` This will download your repository from Docker Hub as a tarball, which you can then extract to a local directory using `tar -xzf`
Comment: That is a very clever workaround. I'm sure this might be considered "hacking" by the Docker community, but it works!
* @fileoverview
* @module
* @version 1.0
* @description
* @main
* @author Nguyen Van Phuc <nguyenvanphuc@gmail.com>
* @date 2019-04-18 20:57
* @moduleScope local
* @export
*/
/*
* @param {Object} data - The request data
*/
/**
* Get the list of tasks
*
* @param {function} success - Called when the list of tasks is obtained
* @param {function} failure - Called when an error occurs
* @param {String} token - The access token used for authentication
*/
function getTasks(success, failure, token) {
// TODO: Implement logic to send request to server and handle response
}
/**
* Get the list of users
*
* @param {function} success - Called when the list of users is obtained
* @param {function} failure - Called when an error occurs
*/
function getUsers() {
// TODO: Implement logic to send request to server and handle response
}
+-----------------------------------------+
| Binary Search Tree: Inserting a node |
| |
| Node Value: 10 |
| Parents: N/A |
| Left Child: N/A |
| Right Child: N/A |
| |
+-----------------------------------------+
The binary search tree is a data structure that uses two pointers to store nodes. The left child pointer points to the node's left subtree and the right child pointer points to the node's right subtree. In this case, both the left and right child pointers are null since we haven't added any children yet.
We can insert a new node into the binary search tree by finding the appropriate location where it should be inserted based on its value. The value of the new node is 10. Since 10 is greater than 5 (the root of the BST), we will start searching for a location in the right subtree.
We can continue this process until we find an empty location where we can insert the new node. Once we have found the appropriate location, we can assign the new node's parent pointer to the parent node and the new node's left and right child pointers to the left and right children of the new node, respectively.
In this case, we will continue searching for a location in the right subtree until we find an empty location where we can insert the new node. We can then assign the new node's parent pointer to the root node (which is null since we haven't added any nodes yet) and the new node's left child pointer to null and its right child pointer to null. This will create a new node with a value of 10 in the BST.
* `{
"name": "Welcome to the world of CakePHP",
"description": "Learn how to build web applications with CakePHP",
"author": "CakePHP"
}`
- [**Introduction:**](#introduction)
- [**Table of Contents:**](#table-of-contents)
- [**Prerequisites:**](#prerequisites)
- [**What is CakePHP?:**](#what-is-cakephp)
- [**Why use CakePHP?:**](#why-use-cakephp)
- [**Installing and Setting up:**](#installing-and-setting-up)
- [**Installing a local development environment:**](#installing-a-local-development-environment)
- [**Setting up the CakePHP framework:**](#setting-up-the-cakephp-framework)
- [**Starting a new application:**](#starting-a-new-application)
- [**Chapter 1: Building your first CakePHP application:**](#chapter-one-building-your-first-cakephp-application)
- [**Setting up the database:**](#setting-up-the-database)
- [**Creating a new controller:**](#creating-a-new-controller)
- [**Creating a new model:**](#creating-a-new-model)
- [**Creating a new view:**](#creating-a-new-view)
- [**Testing the application:**](#testing-the-application)
- [**Chapter 2: Understanding CakePHP models:**](#chapter-two-understanding-cakephp-models)
- [**Introduction to models:**](#introduction-to-models)
- [**Creating models in CakePHP:**](#creating-models-in-cakephp)
- [**Defining a model:**](#defining-a-model)
- [**Inheritance in models:**](#inheritance-in-models)
- [**Data access in CakePHP:**](#data-access-in-cakephp)
- [**Querying data with Active Record:**](#querying-data-with-active-record)
- [**Pagination in CakePHP:**](#pagination-in-cakephp)
- [**Validation in models:**](#validation-in-models)
- [**Basic validation:**](#basic-validation)
- [**Custom validation rules:**](#custom-validation-rules)
- [**Chapter 3: Understanding CakePHP views:**](#chapter-three-understanding-cakephp-views)
- [**Introduction to views:**](#introduction-to-views)
- [**Creating views in CakePHP:**](#creating-views-in-cakephp)
- [**Defining a view:**](#defining-a-view)
- [**View inheritance in CakePHP:**](#view-inheritance-in-cakephp)
- [**Layouts in CakePHP views:**](#layouts-in-cakephp-views)
- [**Defining a layout:**](#defining-a-layout)
- [**Layout inheritance in CakePHP views:**](#layout-inheritance-in-cakephp-views)
- [**Passing data to views:**](#passing-data-to-views)
- [**Using variables in views:**](#using-variables-in-views)
- [**Using helpers in views:**](#using-helpers-in-views)
- [**Chapter 4: Understanding CakePHP controllers:**](#chapter-four-understanding-cakephp-controllers)
- [**Introduction to controllers:**](#introduction-to-controllers)
- [**Creating controllers in CakePHP:**](#creating-controllers-in-cakephp)
- [**Defining a controller:**](#defining-a-controller)
- [**Action inheritance in controllers:**](#action-inheritance-in-controllers)
- [**Routing in CakePHP controllers:**](#routing-in-cakephp-controllers)
- [**Defining routes:**](#defining-routes)
- [**Route inheritance in CakePHP controllers:**](#route-inheritance-in-cakephp-controllers)
- [**Ajax support in controllers:**](#ajax-support-in-controllers)
- [**Defining Ajax actions:**](#defining-ajax-actions)
- [**Using Ajax with CakePHP controllers:**](#using-ajax-with-cakephp-controllers)
- [**Chapter 5: Understanding CakePHP routing:**](#chapter-five-understanding-cakephp-routing)
- [**Introduction to routing:**](#introduction-to-routing)
- [**Routing in CakePHP controllers:**](#routing-in-cakephp-controllers)
- [**Defining routes:**](#defining-routes)
- [**Route inheritance in CakePHP controllers:**](#route-inheritance-in-cakephp-controllers)
- [**Routing in CakePHP views:**](#routing-in-cakephp-views)
- [**Defining links:**](#defining-links)
- [**Link inheritance in CakePHP views:**](#link-inheritance-in-cakephp-views)
- [**Custom routing in CakePHP:**](#custom-routing-in-cakephp)
- [**Defining custom routes:**](#defining-custom-routes)
- [**Using custom routes with controllers:**](#using-custom-routes-with-controllers)
- [**Chapter 6: Understanding CakePHP helpers:**](#chapter-six-understanding-cakephp-helpers)
- [**Introduction to helpers:**](#introduction-to-helpers)
- [**Creating helpers in CakePHP:**](#creating-helpers-in-cakephp)
- [**Defining a helper:**](#defining-a-helper)
- [**Helper inheritance in CakePHP:**](#helper-inheritance-in-cakephp)
- [**Using helpers in controllers:**](#using-helpers-in-controllers)
- [**Defining helper methods:**](#defining-helper-methods)
- [**Using helper methods in controllers:**](#using-helper-methods-in-controllers)
- [**Using helpers in views:**](#using-helpers-in-views)
- [**Defining helper functions:**](#defining-helper-functions)
- [**Using helper functions in views:**](#using-helper-functions-in-views)
- [**Chapter 7: Understanding CakePHP session management:**](#chapter-seven-understanding-cakephp-session-management)
- [**Introduction to session management:**](#introduction-to-session-management)
- [**Session management in CakePHP controllers:**](#session-management-in-cakephp-controllers)
- [**Starting a session:**](#starting-a-session)
- [**Maintaining sessions in CakePHP:**](#maintaining-sessions-in-cakephp)
- [**Session management in CakePHP views:**](#session-management-in-cakephp-views)
- [**Defining session variables:**](#defining-session-variables)
- [**Using session variables in views:**](#using-session-variables-in-views)
- [**Logging out users in CakePHP:**](#logging-out-users-in-cakephp)
- [**Defining a logout method:**](#defining-a-logout-method)
- [**Using the logout method in controllers:**](#using-the-logout-method-in-controllers)
- [**Chapter 8: Understanding CakePHP email:**](#chapter-eight-understanding-cakephp-email)
- [**Introduction to email in CakePHP:**](#introduction-to-email-in-cakephp)
- [**Email configuration in CakePHP:**](#email-configuration-in-cakephp)
- [**Defining email settings:**](#defining-email-settings)
- [**Using email settings in controllers:**](#using-email-settings-in-controllers)
- [**Sending emails in CakePHP views:**](#sending-emails-in-cakephp-views)
- [**Defining email templates:**](#defining-email-templates)
- [**Using email templates in views:**](#using-email-templates-in-views)
- [**Using attachments with emails in CakePHP:**](#using-attachments-with-emails-in-cakephp)
- [**Defining email attachments:**](#defining-email-attachments)
- [**Using email attachments in views:**](#using-email-attachments-in-views)
- [**Chapter 9: Understanding CakePHP authentication:**](#chapter-nine-understanding-cakephp-authentication)
- [**Introduction to authentication in CakePHP:**](#introduction-to-authentication-in-cakephp)
- [**Authentication in CakePHP controllers:**](#authentication-in-cakephp-controllers)
- [**Defining user models:**](#defining-user-models)
- [**Authenticating users in CakePHP:**](#authenticating-users-in-cakephp)
- [**Authentication in CakePHP views:**](#authentication-in-cakephp-views)
- [**Defining login forms:**](#defining-login-forms)
- [**Using login forms in views:**](#using-login-forms-in-views)
- [**Password resetting in CakePHP:**](#password-resetting-in-cakephp)
- [**Defining password reset functionality:**](#defining-password-reset-functionality)
- [**Using password reset functionality in views:**](#using-password-reset-functionality-in-views)
- [**Chapter 10: Understanding CakePHP internationalization:**](#chapter-ten-understanding-cakephp-internationalization)
- [**Introduction to internationalization in CakePHP:**](#introduction-to-internationalization-in-cakephp)
- [**Language configuration in CakePHP:**](#language-configuration-in-cakephp)
- [**Defining language settings:**](#defining-language-settings)
- [**Using language settings in controllers:**](#using-language-settings-in-controllers)
- [**Language configuration in CakePHP views:**](#language-configuration-in-cakephp-views)
- [**Defining language files:**](#defining-language-files)
- [**Using language files in views:**](#using-language-files-in-views)
- [**Localization support in CakePHP:**](#localization-support-in-cakephp)
- [**Defining localized content:**](#defining-localized-content)
- [**Using localized content in views:**](#using-localized-content-in-views)
- **Conclusion**
9/16/2015
In this week’s “Beyond the Hype” segment, we will discuss the new iPhone 6S and 6S Plus. These smartphones were released on September 9th and have received a lot of attention for their features and upgrades from the previous model, the iPhone 6. In this segment, we will break down the hype surrounding these devices and take a closer look at what they really offer.
The first thing to note is that both the iPhone 6S and 6S Plus are very similar in design to their predecessors, the iPhone 6 and 6 Plus. They both have glass backs and aluminum frames, with slightly larger displays and thinner bodies. The most noticeable difference is the addition of a new color option: Rose Gold.
One of the major upgrades for these devices is the camera system. Both the front-facing and rear-facing cameras have been improved, with the rear-facing camera now offering 8MP resolution and the ability to shoot 4K video. The front-facing camera has also been upgraded to 1.2MP, which should result in better selfies and video calls.
Another major update is the inclusion of Apple’s new A8 chip, which offers improved performance and power efficiency. This should result in faster app load times, smoother gameplay, and longer battery life. The screen resolution has also been increased to 1334x750 pixels, which should make everything look sharper and more vibrant.
In terms of storage options, the iPhone 6S and 6S Plus now offer 16GB, 64GB, and 128GB options, as well as the ability to add a microSD card for additional storage. This is a welcome change for those who need more space on their devices.
Finally, Apple has introduced a new feature called 3D Touch, which allows users to interact with their screen in new ways. By pressing down on the display, users can access shortcuts and menus without having to swipe or tap. This should make navigation faster and more intuitive.
Overall, the iPhone 6S and 6S Plus offer some nice upgrades over their predecessors, but they may not be worth the upgrade for everyone. If you are already using an iPhone 6 or later, the improvements may not be significant enough to justify the cost of a new device. However, if you are in the market for a new phone and are looking for something with a good camera, fast performance, and a sleek design, the iPhone 6S and 6S Plus could be worth considering.
08/19/2017
Dear [Recipient],
I am writing to inform you that [event or action] has been completed. Please find the details below.
[Provide details of the event or action, including any relevant information such as dates, times, locations, participants, and outcomes].
Thank you for your interest in this matter. If you have any further questions, please do not hesitate to contact me.
Best regards,
[Your Name]
- 1536: Ponce de León lands in Florida, becoming the first European to set foot on North American soil north of Mexico.
- 1702: The War of Spanish Succession begins in Europe, pitting various powers against each other for control of the Spanish throne.
- 1789: The French Revolution begins, leading to significant changes in French society and government.
2021-06-24
========================================
Aplicação de Pessoas Físicas
----------------------------
Nos últimos anos, a formação do cadastro da pessoa física foi realizada por meio de um documento chamado "CPF", que poderia ser criado apenas uma vez por pessoa. Após o CPF ser criado, o usuário poderia obter diversos documentos como o RG, passaporte ou driver's license (carteira de habilitação).
Através deste projeto, a nossa equipe pretende criar um sistema que facilite a criação de cadastro de pessoas físicas. Além disso, nossa equipe quer criar uma forma de controle de dados de pessoas físicas através de um BD.
Além disso, nos próximos anos temos planos de adição de novos recursos no sistema como:
- O cadastro de empresas
- Controle da entrada e saída do funcionário
- Criação de relatórios
- Atualização dos dados do funcionário
- Criação de usuários com acesso limitado
## 🔧 Instalação
Antes de começar a utilizar nossa API, é necessário instalar o `axios` que será utilizado para fazer requisições HTTP.
```bash
npm install axios
```
## 📝 Requisitos
### Pessoa física
- Nome completo
- Data de nascimento
- Sexo
- RG
- CPF
- CEP
- Logradouro
- Bairro
- Município
- Estado
- País
- Telefone celular
- Telefone residencial
- E-mail
### Endereço
- Data de criação do endereço
- Logradouro
- Número
- CEP
- Bairro
- Município
- Estado
- País
## 📝 Respostas
A API responde com uma mensagem JSON, conterá o seguinte campo:
- `status` - Indica se a requisição foi sucessa ou não (0 = ok; 1 = error);
- `message` - Mensagem explicativa do resultado da requisição;
- `data` - Dados retornados na resposta da requisição.
## 🌐 API Endpoints
### POST - Cadastrar pessoa física
```bash
POST /pessoas/cadastrar
```
#### Requisição
```json
{
"nome": "John Doe",
"data_de_nascimento": "2021-06-24",
"sexo": "Masculino",
"rg": "123456789",
"cpf": "1234567890",
"cep": "12345678",
"logradouro": "Rua A",
"bairro": "Centro",
"município": "São Paulo",
"estado": "SP",
"pais": "Brasil",
"telefone_celular": "1234567890",
"telefone_residencial": "1234567890",
"email": "johndoe@gmail.com"
}
```
#### Resposta
```json
{
"status": 0,
"message": "Pessoa cadastrada com sucesso",
"data": {
"id": 1,
"nome": "John Doe",
"data_de_nascimento": "2021-06-24",
"sexo": "Masculino",
"rg": "123456789",
"cpf": "1234567890",
"cep": "12345678",
"logradouro": "Rua A",
"bairro": "Centro",
"município": "São Paulo",
"estado": "SP",
"pais": "Brasil",
"telefone_celular": "1234567890",
"telefone_residencial": "1234567890",
"email": "johndoe@gmail.com"
}
}
```
### GET - Listar pessoas físicas
```bash
GET /pessoas/listar
```
#### Resposta
```json
{
"status": 0,
"message": "Listagem de pessoas cadastradas",
"data": [
{
"id": 1,
"nome": "John Doe",
"data_de_nascimento": "2021-06-24",
"sexo": "Masculino",
"rg": "123456789",
"cpf": "1234567890",
"cep": "12345678",
"logradouro": "Rua A",
"bairro": "Centro",
"município": "São Paulo",
"estado": "SP",
"pais": "Brasil",
"telefone_celular": "1234567890",
"telefone_residencial": "1234567890",
"email": "johndoe@gmail.com"
},
]
}
```
### GET - Buscar pessoa física pelo CPF
```bash
GET /pessoas/buscar_cpf/{CPF}
```
#### Requisição
```json
{
"CPF": "1234567890"
}
```
#### Resposta
```json
{
"status": 0,
"message": "Busca de pessoa pelo CPF",
"data": {
"id": 1,
"nome": "John Doe",
"data_de_nascimento": "2021-06-24",
"sexo": "Masculino",
"rg": "123456789",
"cpf": "1234567890",
"cep": "12345678",
"logradouro": "Rua A",
"bairro": "Centro",
"município": "São Paulo",
"estado": "SP",
"pais": "Brasil",
"telefone_celular": "1234567890",
"telefone_residencial": "1234567890",
"email": "johndoe@gmail.com"
}
}
```
### POST - Atualizar pessoa física
```bash
PUT /pessoas/atualizar/{id}
```
#### Requisição
```json
{
"nome": "John Doe",
"data_de_nascimento": "2021-06-24",
"sexo": "Masculino",
"rg": "123456789",
"cpf": "1234567890",
"cep": "12345678",
"logradouro": "Rua A",
"bairro": "Centro",
"município": "São Paulo",
"estado": "SP",
"pais": "Brasil",
"telefone_celular": "1234567890",
"telefone_residencial": "1234567890",
"email": "johndoe@gmail.com"
}
```
#### Resposta
```json
{
"status": 0,
"message": "Atualização de pessoa",
"data": {
"id": 1,
"nome": "John Doe",
"data_de_nascimento": "2021-06-24",
"sexo": "Masculino",
"rg": "123456789",
"cpf": "1234567890",
"cep": "12345678",
"logradouro": "Rua A",
"bairro": "Centro",
"município": "São Paulo",
"estado": "SP",
"pais": "Brasil",
"telefone_celular": "1234567890",
"telefone_residencial": "1234567890",
"email": "johndoe@gmail.com"
}
}
```
### POST - Cadastrar endereço
```bash
POST /enderecos/cadastrar/{CPF}/{id}
```
#### Requisição
```json
{
"rua": "Rua A",
"numero": "123",
"complemento": "456",
"bairro": "Centro",
"município": "São Paulo",
"estado": "SP",
"pais": "Brasil"
}
```
#### Resposta
```json
{
"status": 0,
"message": "Cadastro de endereço",
"data": {
"id_pessoa": 1,
"rua": "Rua A",
"numero": "123",
"complemento": "456",
"bairro": "Centro",
"município": "São Paulo",
"estado": "SP",
"pais": "Brasil"
}
}
```
Notes by anna | export