Next.js serverless API for accessing GitHub Gists with authentication.
Check if a gist exists:
{
"gistUri": "https://gist.github.com/username/gist-id"
}
Load gist files and description:
{
"gistUri": "https://gist.github.com/username/gist-id"
}
- Install dependencies:
npm install
- Set GitHub token:
- Create a GitHub personal access token with
gist
scope - Add it to Vercel:
vercel env add GITHUB_TOKEN
- Run development server:
vercel dev
See test-commands.md for curl commands to test the API endpoints.
https://stan-playground.flatironinstitute.org
http://localhost:*
andhttps://localhost:*
http://127.0.0.1:*
andhttps://127.0.0.1:*
400
: Bad request403
: Access forbidden404
: Gist not found500
: Server error
MIT