Set env when remixing from API


#1

Hi guys,

I’ve been playing around with the API and can remix from a project no problems, but does anyone know how to pass env variables when remixing/starting a new project via the API?

Cheers,

J


#2

You can populate the values in a project’s .env file on remix. Just pop the variable names and corresponding values on the end of your remix URL, like so:
https://glitch.com/edit/#!/remix/project-name?var1=value1&var2=value2


#3

Awesome, thanks for that Gareth. Slightly different topic, but whats the syntax for a PATCH request to projects/project-name? I wanted to play around with renaming projects


#4

It’s PATCH /projects/, and you include a JSON body with the values you want to change. You want {domain: 'newdomain'}. It won’t work with the project domain in the URL - you need the UUID for the project.


#5

You can set the env values programmatically: See Programmatically set env file? Per-student setup

However I was unable to remix my project via the API – received an error message. (See the other thread.)