This commit is contained in:
2022-04-20 18:25:59 -03:00
parent 9a64f7155c
commit 4636558d3b
5 changed files with 27 additions and 2 deletions

View File

@@ -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')

View File

@@ -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}
}
}