From 71159a9a476a96629de1808fee86c07f11e6a3d4 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 1 Apr 2021 14:00:51 -0400 Subject: [PATCH] Hide Google Calendar API key in an external secrets file --- .gitignore | 1 + src/App.vue | 4 +++- tsconfig.json | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fe722d1..7a0c801 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /.cache/ /dist/ /package-lock.json +/src/secrets.json diff --git a/src/App.vue b/src/App.vue index f64d6ad..c6d4a60 100644 --- a/src/App.vue +++ b/src/App.vue @@ -14,6 +14,8 @@ import googleCalendarPlugin from '@fullcalendar/google-calendar'; import { EventInput, CalendarOptions } from '@fullcalendar/core'; import { Calendar } from '@fullcalendar/core'; +import { googleCalendarApiKey } from './secrets.json'; + const calendars: { [key: string]: string } = { computer_lab: '6mmjp85e4732ru6skf1dda54ls@group.calendar.google.com', electronics: '1g8atbdschshrg2inf162rcqt4@group.calendar.google.com', @@ -37,7 +39,7 @@ export default class App extends Vue { nowIndicator: true, initialView: 'timeGridWeek', height: 'auto', - googleCalendarApiKey: 'AIzaSyAQ46fgaqbekkmJqaKR0NCXntaJA6H8JoQ', + googleCalendarApiKey, slotMinTime: '8:00', slotMaxTime: '22:00', businessHours: { diff --git a/tsconfig.json b/tsconfig.json index a706abd..06e399d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,7 @@ "target": "es5", "strict": true, "module": "es2015", - "moduleResolution": "node" + "moduleResolution": "node", + "resolveJsonModule": true } }