feat: revert to using official twitter embedding sdk; bump deps

This commit is contained in:
Travis Fischer
2022-04-19 21:24:55 -04:00
parent aed9b2037d
commit 8163ce123d
8 changed files with 27 additions and 852 deletions

View File

@@ -1,25 +0,0 @@
import { NextApiRequest, NextApiResponse } from 'next'
import { fetchTweetAst } from 'static-tweets'
export default async (
req: NextApiRequest,
res: NextApiResponse
): Promise<void> => {
if (req.method !== 'GET') {
return res.status(405).send({ error: 'method not allowed' })
}
const tweetId = req.query.tweetId as string
if (!tweetId) {
return res
.status(400)
.send({ error: 'missing required parameter "tweetId"' })
}
console.log('getTweetAst', tweetId)
const tweetAst = await fetchTweetAst(tweetId)
console.log('tweetAst', tweetId, tweetAst)
res.status(200).json(tweetAst)
}