https://github.com/simoneas02/api-node-example
https://github.com/simoneas02/api-node-example
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/simoneas02/api-node-example
- Owner: simoneas02
- License: mit
- Created: 2019-08-25T16:02:27.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-09T03:21:18.000Z (almost 7 years ago)
- Last Synced: 2025-02-01T15:22:02.403Z (over 1 year ago)
- Language: JavaScript
- Size: 41 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# api-node-example
> A simple `api` created with `NodeJS`, `express` and `mongo` just for my learnning.
## Run the project local
**0 -** install the basic dependencies
- [NodeJS](https://nodejs.org/en/)
- [Mongo](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/)
**1 -** Clone the project and install the dependencies:
```sh
$ git clone https://github.com/simoneas02/api-node-example
$ cd api-node-example/
$ yarn
```
**2 -** Start development mode:
```sh
$ yarn start
```
## You can use the fllowing endpoints:
### Resgister
- Create a POST request to `http://localhost:3000/auth/resgister`
- Header should be `application/json`
- Body should contain the following fields:
```JSON
{
"name": "some-name",
"email": "some-email.com",
"password": "some-password"
}
```
### Authenticate
After that you created an User:
- Create a POST request to `http://localhost:3000/auth/authenticate`
- Header should be `application/json`
- Body should contain the following fields:
```JSON
{
"email": "some-email.com",
"password": "some-password"
}
```
### Projects
After that you created an User:
- Create a GET request to `http://localhost:3000/projects`
- Body should be empty
- Header should contain the following key and value:
```
key: Authorization
value: Bearer some-crazy-token
```
### Forgot Password
After that you created an User:
- Create a POST request to `http://localhost:3000/auth/forgot_password`
- Header should be `application/json`
- Body should contain the following fields:
```JSON
{
"email": "some-email.com",
}
```
### Reset Password
After that you created an User and got your token on your email:
- Create a POST request to `http://localhost:3000/auth/reset_password`
- Header should be `application/json`
- Body should contain the following fields:
```JSON
{
"email": "some-email.com",
"token": "crazy-token",
"password": "new-password"
}
```
## Contributing
Find on our [issues](https://github.com/simoneas02/api-node-example/issues/) the next steps of the project ;)
Want to contribute? [Follow these recommendations](https://github.com/simoneas02/api-node-example/blob/master/CONTRIBUTING.md).
## History
See [Releases](https://github.com/simoneas02/api-node-example/releases) for detailed changelog.
## License
[MIT License](https://github.com/simoneas02/api-node-example/blob/master/LICENSE.md) © [Simone Amorim](https://simoneas02.github.io)