Public
Like
blockbench-plugin
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
This Val Town service fetches JavaScript or TypeScript files from GitHub repositories or Gists and serves them with the proper content type headers (application/javascript
).
To fetch a file from a GitHub repository:
/github/:owner/:repo/:branch/:path
Example:
/github/microsoft/TypeScript/main/lib/typescript.js
To fetch a file from a GitHub Gist:
/gist/:gistId/:filename
Example:
/gist/a1b2c3d4e5f6g7h8i9j0/example.js
The service automatically sets the appropriate content type header based on the file extension:
.js
,.mjs
,.cjs
:application/javascript
.ts
,.tsx
,.jsx
:application/javascript
(TypeScript files are served as JavaScript).json
:application/json
- Other file types:
text/plain
- CORS enabled (Access-Control-Allow-Origin: *)
- Caching (Cache-Control: public, max-age=3600)
- Error handling for invalid URLs or unavailable files
- Only GET requests are supported
- Files are served as-is without any transformation or transpilation
- GitHub API rate limits may apply