There are two pre-built ways to deploy code written in VisionScript:
- Using a VisionScript notebook
- Using the command line
Below, we show how to deploy your app with both methods. Let's begin!
Deploy via Notebook
VisionScript comes with an interactive deployment tool out-of-the-box in VisionScript Notebook.
To deploy a VisionScript app, first run VisionScript Notebook, the software through which you can create an interactive application. You can run VisionScript Notebook using the following code:
You will also need to start VisionScript Cloud, a web tool that lets you run VisionScript programs as web pages and via an API:
When VisionScript Cloud starts, a message will appear with your API key:
Your API key is [API_KEY]
Take a note of your API key, as you will need it later.
Next, write your program in the notebook:
Once you have written your program, click the "Use as Web App" button at the top of the page:
You will be asked to provide:
- A name for your app
- The URL of your VisionScript Cloud server (see below for more information)
- Your VisionScript API key
- An application description (optional)
By default, your VisionScript Cloud URL will be:
Your API key is the key you were given when you started the VisionScript Cloud server.
After you have filled out the required information, click "Submit" in the deployment pop up in your notebook. A message will appear with the URL of your deployed application. If something went wrong during deployment, a message will appear explaining the issue.
Deploy via CLI
First, start VisionScript Cloud, a web tool that lets you run VisionScript programs as web pages and via an API:
You can deploy a
.vic file using the following command:
visionscript --deploy --file=./filename.vic --name="App name" --description=="App description"
description values as appropriate.
This command will return the URL to your deployed application. If something went wrong during deployment, a message will appear explaining the issue.