-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
24 lines (19 loc) · 664 Bytes
/
app.js
File metadata and controls
24 lines (19 loc) · 664 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
const dotenv = require('dotenv');
dotenv.config();
const fs = require('fs');
const path = require('path');
const utils = require('./lib/helpers/index.helper');
const mainTask = require('./lib/tasks/main.task');
global.appRoot = path.resolve(__dirname);
const main = async () => {
try {
fs.readFile('./configs/google_access/credentials.json', (err, content) => {
if (err) return console.log('Error loading client secret file:', err);
// Authorize a client with credentials, then call the Google Sheets API.
utils.authorize(JSON.parse(content), auth => mainTask(auth));
});
} catch (error) {
console.log(error);
}
};
main();