Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mhdez221993/countries_api
This API has 5 end points where the first 3 are for authentication and the other 2 return one or all countries for a given string
https://github.com/mhdez221993/countries_api
authentication jwt nodejs resful-api
Last synced: about 1 month ago
JSON representation
This API has 5 end points where the first 3 are for authentication and the other 2 return one or all countries for a given string
- Host: GitHub
- URL: https://github.com/mhdez221993/countries_api
- Owner: Mhdez221993
- Created: 2022-05-05T17:50:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-07T21:18:52.000Z (over 2 years ago)
- Last Synced: 2024-10-03T12:35:04.763Z (about 2 months ago)
- Topics: authentication, jwt, nodejs, resful-api
- Language: JavaScript
- Homepage:
- Size: 207 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Restcountries API
This API has 5 end points where the first 3 are for authentication and the other 2 return one or all countries for a given string
- `/api/v1/auth/signup` --> signup takes name, email and password and save them to postgrestsql on heroku.
- `/api/v1/auth/login` --> login takes email and password and authenticate the user returning a token.
- `/api/v1/auth/logout` --> logout destroy the user session by removing the token from the cookies.
- `/api/v1/countries/search-all` --> search-all return all the contries tha match a givent string.
- `/api/v1/countries/search-one` --> search-one return one contriy tha match a givent string.![api](https://user-images.githubusercontent.com/67757001/165146174-f64f71ca-e6ef-4bb5-8c06-8e278e40d495.jpg)
## Built With
- Node
- Jest
- JWT
- Supertest## Getting Started
To get a local copy up and running follow these simple example steps.
Run in your terminal `git clone [email protected]:Mhdez221993/restcountries_api.git`
## Start the app
```
npm run dev
```## Start studio to check the user been saved in the database
```
npm run studio
```## Run some test
```
npm run test
```## Helpful links
- [Crafting authentication schemes with Prisma in Express](https://blog.logrocket.com/crafting-authentication-schemes-with-prisma-in-express/)
- [Hashing passwords in NodeJS with bcrypt](https://sebhastian.com/bcrypt-node/)
- [How to Build an Authentication API with JWT Token in Node.js](https://www.section.io/engineering-education/how-to-build-authentication-api-with-jwt-token-in-nodejs/)
- [cors compatibility](https://github.com/expressjs/cors)
- [forms-validation](https://react-bootstrap.github.io/forms/validation/)## Authors
👤 **Moises Hernandez**
- GitHub: [@Mhdez221993](https://github.com/Mhdez221993)
- Twitter: [@MoisesH42060050](https://twitter.com/MoisesH42060050)
- LinkedIn: [Moises Hernandez Coronado](https://www.linkedin.com/in/moises-hernandez-9bbb17145/)## Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the [issues page](https://github.com/Mhdez221993/restcountries_api/issues).
## Show your support
Give a ⭐️ if you like this project!
## Acknowledgments
- To the [jobsqd](https://www.jobsqd.com/) for providing the test project