https://github.com/erosnol/contactsapi
Using CRUD to make a Contact list (email, phone, date, name, etc..)
https://github.com/erosnol/contactsapi
Last synced: about 2 months ago
JSON representation
Using CRUD to make a Contact list (email, phone, date, name, etc..)
- Host: GitHub
- URL: https://github.com/erosnol/contactsapi
- Owner: erosnol
- Created: 2022-06-07T15:44:54.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-11T00:06:45.000Z (almost 3 years ago)
- Last Synced: 2025-02-15T00:15:01.943Z (4 months ago)
- Language: JavaScript
- Size: 2.93 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ContactsAPI
Using CRUD to make a Contact list (email, phone, date, name, etc..)
Instructions: - CRUD practice.. DELETE & UPDATECreate a new folder contacts_api:
1- Create a new file server.js
2- Init your project npm init -y => inside the contacts_api folder
3- Add your .gitignore file, make sure to add node_modules/ and .env
4- Install your dependencies (express, dotenv, mongoose)
5- Create your Express server
6- Create the mongoConfig file to connect to your database (give your database a new name in the MongoDB URI in your .env file)
7- Create the contactsRouter that will handle all the requests to the endpoint '/contacts
8- Create the Schema / Model for Contacts
9- Create the Schema / Model for Users
10- When you're using Postman to test your new API, create a new Collection so that you can organize all of the request.
CONTACT Schema:
name: type: String, required: true
email: type: String,
phone: type: String, required: true
contactType: type: String, default: 'personal'
created_at: type: Date, default: Date.now()
CONTACT Schema:
username-> type: String, required: true
email -> type: String, required: true,
password: -> type: String, required: true,
date -> type: Date, default: Date.now()