You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.
import axios from 'axios'
import { setupCache } from 'axios-cache-adapter'
// Create
axios-cache-adapter
instanceconst cache = setupCache({
maxAge: 5 * 60 * 1000,
})
const api = axios.create({
adapter: cache.adapter,
})
export const getTimeline = async () => {
let tweets = {}
const response = await api({
url:
'https://api.twitter.com/2/users/106699049/tweets?exclude=retweets,replies',
headers: {
Authorization:
Bearer ${process.env.TWITTER_API_KEY}
,},
method: 'get',
})
const length = await cache.store.length()
console.log('Cache store length:', length)
tweets = response.data.data
return tweets
}
The text was updated successfully, but these errors were encountered: