mirror of
https://github.com/TurboWarp/packager.git
synced 2024-11-25 16:35:59 +08:00
Use /api instead of /proxy in trampoline examples
This commit is contained in:
parent
ce0882372c
commit
e83b0a0b8b
@ -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();
|
||||
```
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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();
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user