Use /api instead of /proxy in trampoline examples

This commit is contained in:
GarboMuffin 2023-04-14 17:48:40 -05:00
parent ce0882372c
commit e83b0a0b8b
3 changed files with 3 additions and 3 deletions

View File

@ -62,7 +62,7 @@ const projectData = fs.readFileSync('project.sb3');
// or fetch a shared Scratch project:
const fetch = require('cross-fetch').default; // or whatever your favorite HTTP library is
const id = '437419376';
const projectMetadata = await (await fetch(`https://trampoline.turbowarp.org/proxy/projects/${id}`)).json();
const projectMetadata = await (await fetch(`https://trampoline.turbowarp.org/api/projects/${id}`)).json();
const token = projectMetadata.project_token;
const projectData = await (await fetch(`https://projects.scratch.mit.edu/${id}?token=${token}`)).arrayBuffer();
```

View File

@ -9,7 +9,7 @@ const Packager = require('../dist/packager');
const run = async () => {
// Example of how to fetch() a project from Scratch:
const id = '437419376';
const projectMetadata = await (await fetch(`https://trampoline.turbowarp.org/proxy/projects/${id}`)).json();
const projectMetadata = await (await fetch(`https://trampoline.turbowarp.org/api/projects/${id}`)).json();
const token = projectMetadata.project_token;
const projectData = await (await fetch(`https://projects.scratch.mit.edu/${id}?token=${token}`)).arrayBuffer();

View File

@ -163,7 +163,7 @@ Downloading shared Scratch projects can be done manually with something like thi
```js
const id = '437419376';
const projectMetadata = await (await fetch(`https://trampoline.turbowarp.org/proxy/projects/${id}`)).json();
const projectMetadata = await (await fetch(`https://trampoline.turbowarp.org/api/projects/${id}`)).json();
const token = projectMetadata.project_token;
const projectData = await (await fetch(`https://projects.scratch.mit.edu/${id}?token=${token}`)).arrayBuffer();
```