createContacts.js created
This commit is contained in:
1 parent
4895f4df8b
commit
00553e77fb
4 files changed
+38
-31
No files matched your search
+3
-3
@@ -2,13 +2,13 @@ var fs = require('fs');
|
||||
var axios = require('axios');
|
||||
var express = require('express');
|
||||
const auth = require('../cfg/auth.js');
|
||||
const FILE_PATH = require('./last-modified-date.json');
|
||||
|
||||
|
||||
const app = express();
|
||||
const port = 3000;
|
||||
app.use(express.json());
|
||||
|
||||
var server = app.listen(3000, () => { console.log('Please your hubspot instance and next click on http://localhost:3000/install or http://localhost:3000/renew') })
|
||||
//var server = app.listen(3000, () => { console.log('Please your hubspot instance and next click on http://localhost:3000/install or http://localhost:3000/renew') })
|
||||
|
||||
// used to initiate the authorization flow to connect the app with Hubspot
|
||||
app.get('/install', async (req, res) => {
|
||||
@@ -69,7 +69,7 @@ app.get('/oauth-callback', async (req, res) => {
|
||||
}
|
||||
|
||||
token.issued_at=Date.now();
|
||||
fs.writeFileSync( FILE_PATH, JSON.stringify({ lastRun: token }, null, 2));
|
||||
fs.writeFileSync( configPath, JSON.stringify(token));
|
||||
|
||||
console.log(token);
|
||||
res.send(`ok`);
|
||||
|
||||
Reference in new issue
Block a user