-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
48 lines (33 loc) · 811 Bytes
/
app.js
File metadata and controls
48 lines (33 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const express = require("express");
const app = express();
const dotenv = require("dotenv");
const {createContact, readContact, updateContact, deleteContact, readAllContact} = require('./Hubspot')
// CRUD Operations
// Contact
readAllContact().then(res => {
console.log(res)
})
//READ
readContact('201').then(res => {
console.log(res)
})
//CREATE
const properties = {
"company": "test2Contact",
"email": "test2@gmail.com",
"firstname": "test2",
"lastname": "test2",
};
createContact(properties)
//UPDATE
const updateproperties = {
"company": "UpdatedNameTest2",
"email": "test2@gmail.com",
"firstname": "test2update",
"lastname": "test2",
};
updateContact('251', updateproperties)
//DELETE or ARCHIVE
deleteContact('201')
readAllContact()
// Companies