Skip to content

magland/stan-playground-gist-access

Repository files navigation

GitHub Gist Access API

Next.js serverless API for accessing GitHub Gists with authentication.

API Endpoints

POST /api/gist/exists

Check if a gist exists:

{
  "gistUri": "https://gist.github.com/username/gist-id"
}

POST /api/gist/load

Load gist files and description:

{
  "gistUri": "https://gist.github.com/username/gist-id"
}

Quick Start

  1. Install dependencies:
npm install
  1. Set GitHub token:
  • Create a GitHub personal access token with gist scope
  • Add it to Vercel:
vercel env add GITHUB_TOKEN
  1. Run development server:
vercel dev

Test commands

See test-commands.md for curl commands to test the API endpoints.

CORS Support

  • https://stan-playground.flatironinstitute.org
  • http://localhost:* and https://localhost:*
  • http://127.0.0.1:* and https://127.0.0.1:*

Error Codes

  • 400: Bad request
  • 403: Access forbidden
  • 404: Gist not found
  • 500: Server error

License

MIT

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published