Skip to content

Commit

Permalink
Add CORS (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
leordev authored Nov 20, 2023
1 parent b7152d4 commit 9ed35a2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ require('dotenv').config();
const express = require('express');
// Logging
const logger = require('pino')();
// Enable CORS
const cors = require('cors');

/*
* Configuration
Expand Down Expand Up @@ -53,6 +55,12 @@ var calendarEvents;
* Set up HTTP Server
*/
const app = express();

/*
* Configure CORS
*/
app.use(cors());

app.listen(HTTP_PORT, (error) => {
if (!error) {
logger.info("Server running on port: " + HTTP_PORT);
Expand Down
21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"dependencies": {
"@google-cloud/local-auth": "2.1.0",
"cors": "2.8.5",
"dotenv": "16.3.1",
"express": "4.18.2",
"googleapis": "105.0.0",
Expand Down

0 comments on commit 9ed35a2

Please sign in to comment.