-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
41 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,9 @@ | |
"@/contexts/*": [ | ||
"contexts/*" | ||
], | ||
"@/middlewares/*": [ | ||
"middlewares/*" | ||
], | ||
} | ||
}, | ||
"exclude": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module.exports = { | ||
siteUrl: 'https://theconvo.space', | ||
changefreq: 'daily', | ||
priority: 0.7, | ||
sitemapSize: 5000, | ||
generateRobotsTxt: true, | ||
} | ||
siteUrl: 'https://theconvo.space', | ||
changefreq: 'daily', | ||
priority: 0.7, | ||
sitemapSize: 5000, | ||
generateRobotsTxt: true, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
import Ably from "ably/promises"; | ||
import withApikey from "@middlewares/withApikey"; | ||
|
||
export default async function handler(req, res) { | ||
|
||
if (req.method === 'OPTIONS') { | ||
return res.status(200).end(); | ||
} | ||
|
||
if (Object.keys(req.query).includes('apikey') === false || req.query.apikey !== 'CONVO' ){ | ||
return res.status(401).json({ | ||
'success':false, | ||
'error': 'Invalid API key, please refer to the integration docs at https://docs.theconvo.space/ to see how to get and use a new API key.' | ||
}); | ||
} | ||
|
||
const handler = async(req, res) => { | ||
|
||
const client = new Ably.Realtime(process.env.ABLY_SUBSCRIBE_API_KEY); | ||
const tokenRequestData = await client.auth.createTokenRequest({ clientId: 'convo' }); | ||
res.status(200).json(tokenRequestData); | ||
} | ||
|
||
export default withApikey(handler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters