top | item 39896909

(no title)

dillonnys | 1 year ago

Glad to hear you ran a successful deploy!

Currently we just have the CLI to manage your account, although I'm working on a web-based dashboard for better accessibility.

The result of a deployment is just a URL, which is automatically placed in your generated client (see `celest/lib/client.dart`). To switch to this new environment, pass the production arg to your `celest.init` call like this:

    void main() {
      celest.init(environment: CelestEnvironment.production);
      runApp(MyApp());
    }
Let me know if you face any issues! We have a Discord (https://celest.dev/discord) server, and you're more than welcome to open a GitHub issue if you experience problems: https://github.com/celest-dev/celest

discuss

order

marcglasberg|1 year ago

Just to clarify what Dillon said:

When you do `celest deploy` it sends your current code to the cloud. After that if your code contains: `celest.init(environment: CelestEnvironment.production);` it will use that code you just sent to the cloud. If your code contains `celest.init(environment: CelestEnvironment.local);` it will use the code you have in your local machine.

But in practice you develop locally, so you don't need to deploy all the time.

Also, you can call `celest.init` as many times as you like, while the app is running, to change from local to cloud and vice-versa, on the fly!