First app: Difference between revisions
(Tutorial for creating, initializing, and deploying your first Volt app) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
VoltServer is designed to require very little code to get started. Currently, there are two ways to create and upload an app: | |||
# From the "Your Apps" page in the [https://dashboard.voltcloud.io dashboard] click on "+ Add App". Once your App has been created, you can click on the "Upload" button on the "App Information" page. This will prompt you to upload a zip file of your app. | |||
# You can upload any app you create in [[Faq#AppStudio_Users|AppStudio]]. | |||
We're working to allow apps to be uploaded and deployed using a wide variety of common tools. | We're working to allow apps to be uploaded and deployed using a wide variety of common tools. | ||
Line 8: | Line 8: | ||
== Initializing == | == Initializing == | ||
Once you've created a new app and obtained your app ID from the Dashboard, you can create your first | Once you've created a new app and obtained your app ID from the Dashboard, you can create your first VoltServer app. The following example shows the simplest functioning app you could create: | ||
<syntaxhighlight lang="html" highlight="9,10,11,12,13"> | <syntaxhighlight lang="html" highlight="9,10,11,12,13"> | ||
Line 15: | Line 15: | ||
<head> | <head> | ||
<meta charset="utf-8"> | <meta charset="utf-8"> | ||
<title> | <title>VoltServer Example</title> | ||
</head> | </head> | ||
<body> | <body> | ||
Line 30: | Line 30: | ||
The highlighted section of this example is the most important. It shows two sets of script tags: | The highlighted section of this example is the most important. It shows two sets of script tags: | ||
# The first script tag includes the Volt [https://docs.voltcloud.io/client/ client library]. The library will always be available at this location when your app is hosted on the Volt server. | |||
# The second script tag initializes your app. Every app has an ID, and you must initialize volt with your app ID before you can use the client library to make further Volt calls. | |||
== For AppStudio Users == | == For AppStudio Users == | ||
AppStudio is tightly integrated with | AppStudio is tightly integrated with VoltServer, making it easy to upload, run and manage your apps. | ||
=== Uploading to | === Uploading to VoltServer === | ||
On the Run menu, choose "Deploy to | On the Run menu, choose "Deploy to VoltServer". Your app will be uploaded to VoltServer and the URL to run it will be displayed. The VoltServer AppId will be placed in your [[Properties_Window|Project Properties]]. | ||
=== Managing your App === | === Managing your App === | ||
If you have subscribed to AppStudio and have entered a | If you have subscribed to AppStudio and have entered a VoltServer password, you can use the VoltServer [https://dashboard.voltcloud.io/ Dashboard] to [[Manage_apps|manage your apps]]. | ||
You can open the Dashboard at [https://dashboard.voltcloud.io/ https://dashboard.voltcloud.io/] or from the AppStudio [[Menu_Options|Run menu]]. | You can open the Dashboard at [https://dashboard.voltcloud.io/ https://dashboard.voltcloud.io/] or from the AppStudio [[Menu_Options|Run menu]]. | ||
=== Managing your | === Managing your VoltServer Account === | ||
If you have [https://www.nsbasic.com/i/Subscription/ subscribed] to AppStudio on any of the plans (including the free demo), you're entitled to deploy to | If you have [https://www.nsbasic.com/i/Subscription/ subscribed] to AppStudio on any of the plans (including the free demo), you're entitled to deploy to VoltServer from the AppStudio Run menu. | ||
To use the [https://dashboard.voltcloud.io/ Dashboard], you'll need a | To use the [https://dashboard.voltcloud.io/ Dashboard], you'll need a VoltServer account. If you have a Starter, Essential or Pro subscription, you're entitled to a free VoltServer account. Reply to the registration confirmation email by setting up a password and you'll be allowed to use it. | ||
You can also set up a | You can also set up a VoltServer account from the AppStudio Run menu or from [[Preferences|VoltServer Preferences]]. | ||
== Reference == | == Reference == | ||
* JavaScript API: [https://docs.voltcloud.io/client/$volt.html#.init https://docs.voltcloud.io/client/$volt.html#.init] | * JavaScript API: [https://docs.voltcloud.io/client/$volt.html#.init https://docs.voltcloud.io/client/$volt.html#.init] |
Latest revision as of 15:20, 25 February 2021
VoltServer is designed to require very little code to get started. Currently, there are two ways to create and upload an app:
- From the "Your Apps" page in the dashboard click on "+ Add App". Once your App has been created, you can click on the "Upload" button on the "App Information" page. This will prompt you to upload a zip file of your app.
- You can upload any app you create in AppStudio.
We're working to allow apps to be uploaded and deployed using a wide variety of common tools.
Initializing
Once you've created a new app and obtained your app ID from the Dashboard, you can create your first VoltServer app. The following example shows the simplest functioning app you could create:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>VoltServer Example</title>
</head>
<body>
<p>It doesn't get much simpler than this!</p>
<script src="/api/client/volt.min.js"></script>
<script>
var appId = 'abc123';
$volt.init(appId);
</script>
</body>
</html>
The highlighted section of this example is the most important. It shows two sets of script tags:
- The first script tag includes the Volt client library. The library will always be available at this location when your app is hosted on the Volt server.
- The second script tag initializes your app. Every app has an ID, and you must initialize volt with your app ID before you can use the client library to make further Volt calls.
For AppStudio Users
AppStudio is tightly integrated with VoltServer, making it easy to upload, run and manage your apps.
Uploading to VoltServer
On the Run menu, choose "Deploy to VoltServer". Your app will be uploaded to VoltServer and the URL to run it will be displayed. The VoltServer AppId will be placed in your Project Properties.
Managing your App
If you have subscribed to AppStudio and have entered a VoltServer password, you can use the VoltServer Dashboard to manage your apps.
You can open the Dashboard at https://dashboard.voltcloud.io/ or from the AppStudio Run menu.
Managing your VoltServer Account
If you have subscribed to AppStudio on any of the plans (including the free demo), you're entitled to deploy to VoltServer from the AppStudio Run menu.
To use the Dashboard, you'll need a VoltServer account. If you have a Starter, Essential or Pro subscription, you're entitled to a free VoltServer account. Reply to the registration confirmation email by setting up a password and you'll be allowed to use it.
You can also set up a VoltServer account from the AppStudio Run menu or from VoltServer Preferences.
Reference
- JavaScript API: https://docs.voltcloud.io/client/$volt.html#.init