diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..aaaabcd --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,22 @@ +{ + "workbench.colorCustomizations": { + "activityBar.activeBackground": "#2f7c47", + "activityBar.activeBorder": "#422c74", + "activityBar.background": "#2f7c47", + "activityBar.foreground": "#e7e7e7", + "activityBar.inactiveForeground": "#e7e7e799", + "activityBarBadge.background": "#422c74", + "activityBarBadge.foreground": "#e7e7e7", + "sash.hoverBorder": "#2f7c47", + "statusBar.background": "#215732", + "statusBar.foreground": "#e7e7e7", + "statusBarItem.hoverBackground": "#2f7c47", + "statusBarItem.remoteBackground": "#215732", + "statusBarItem.remoteForeground": "#e7e7e7", + "titleBar.activeBackground": "#215732", + "titleBar.activeForeground": "#e7e7e7", + "titleBar.inactiveBackground": "#21573299", + "titleBar.inactiveForeground": "#e7e7e799" + }, + "peacock.color": "#215732" +} \ No newline at end of file diff --git a/readme.MD b/README.md similarity index 100% rename from readme.MD rename to README.md diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index b69e332..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/src/index.js b/src/index.js index 5d1e0a1..785c4ab 100644 --- a/src/index.js +++ b/src/index.js @@ -3,6 +3,10 @@ const app = Express() const port = (process.env.PORT || 3030) require('dotenv').config() +//Enable CORS +const cors = require('cors'); +app.use(cors()) + //Configure Handlebars const hbs = require('hbs') hbs.registerPartials(__dirname + '/../views/partials') diff --git a/src/routes/authRouter.js b/src/routes/authRouter.js index 15a361f..52cf8c3 100644 --- a/src/routes/authRouter.js +++ b/src/routes/authRouter.js @@ -8,7 +8,7 @@ router.get('/', async (req, res) => { async function requestAccessToken() { try { const reqData = { - code: req.query.code, + code: req.headers.code, grant_type: "authorization_code", redirect_uri: "https://telegram-to-notion.herokuapp.com/auth" } @@ -45,7 +45,6 @@ router.get('/', async (req, res) => { } catch (error) { console.log(error) - return {status: 400} } }