I’m working on an online editor for a game engine of mine. When the user is ready to “publish” I want to give them the option to publish to Glitch. Is there an api I can use to do this?
No, not at the moment - but it’s something we plan to add!
It’s nice to hear that you have future plans with a public API. That’ll also allow the community to make cool stuff, for example a Glitch VSCode module or something. ^^hint, hint^^
One way you could make this work right now would be to have a base project that contains a working version of the project, and then do a remix as part of the publish process. The part that would be tricky is that you would also have to send the edited files after the remix, so you would need to add an endpoint in the project for uploading the files.
Waking up thread to see if there’s been any updates in this area??
I’m really interested in exactly this for use with my students. They’re coding p5.js projects and within a custom environment, can produce a nice single page html file that I’d love to be able to deploy to glitch (replacing the index.html or a sketch.js file) – so they could instantly test/share projects via this great platform. Wondering what option I have and if anything has changed since previous similar questions were asked?
-
Possible to remix a project along with a file as part of the POST call that adds (better yet, replaces) a file in the project?
-
Possible that an app can take an .env value that’s sent via POST when remixing a project, to then take that value and overwrite an app’s own file? ie. something that executes upon creation to use this sent string (code in JSON format) and replace the contents of either index.html or a sketch.js file?
though this isn’t the api i know that you can clone a git repo by going to https://glitch.com/edit/#!/remix/clone-from-repo?REPO_URL=${gitRepo}