Skip to content

Commit

Permalink
using existing variable
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoffat committed Jan 21, 2025
1 parent 62edb9d commit 3e9f773
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/api/signup-submit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { google } from 'googleapis';
import { fs } from 'fs';


export default async function handler(req, res) {
console.log(`submitted form`, req.body, __filename)
Expand All @@ -8,7 +10,9 @@ export default async function handler(req, res) {

const eventId = req.body.eventId;

const CREDENTIALS = JSON.parse(process.env.GOOGLE_SERVICE_ACCOUNT) ? process.env.GOOGLE_SERVICE_ACCOUNT : require('./calendar-service-account.json')
const CREDENTIALS = process.env.GOOGLE_SERVICE_ACCOUNT ?
JSON.parse(process.env.GOOGLE_SERVICE_ACCOUNT) :
fs.readFileSync('./calendar-service-account.json')

console.log(`CREDENTIALS`, CREDENTIALS)

Expand Down

0 comments on commit 3e9f773

Please sign in to comment.