File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
sim/app/(landing)/components Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2,17 +2,20 @@ import { Star } from 'lucide-react'
22import { GithubIcon } from '@/components/icons'
33
44async function getGitHubStars ( ) {
5+ const token = process . env . GITHUB_TOKEN
6+
57 const response = await fetch ( 'https://api.github.com/repos/simstudioai/sim' , {
68 headers : {
79 Accept : 'application/vnd.github+json' ,
810 'X-GitHub-Api-Version' : '2022-11-28' ,
11+ ...( token ? { Authorization : `Bearer ${ token } ` } : { } ) ,
912 } ,
1013 next : { revalidate : 3600 } , // Revalidate every hour
1114 } )
1215
1316 if ( ! response . ok ) {
14- // Return 0 stars if API fails, we don't want to break the UI
15- return 0
17+ // Return current stars if API fails, we don't want to break the UI
18+ return 65
1619 }
1720
1821 const data = await response . json ( )
You can’t perform that action at this time.
0 commit comments