Motoko: environment check

If there is a way to check if current environment is development or production in motoko code?

Something like we have in node: process.env.NODE_ENV === "development"

@rossberg @claudio

No, no such mechanism exists today. Your best bet right now is to have a build script that creates a Motoko file with a boolean or a variant value in it, and then import it from your main program.

2 Likes

Hmm I guess one can check the canister Id and then set it that way?