In this quick tutorial, you'll learn how to create and deploy static assets you can access from https. We will take an example of a basic index.html file.
1. Create a ScaleDynamics account
You can sign up here to create your account. Subscription is FREE, no credit card required.
2. Prepare the directory and create a basic html file
Create working directory
Let's create a
my-assets working directory.
mkdir my-assets mkdir my-assets/public cd my-assets/
npm init -y
Create html file to deploy
Create a new
public/index.html file, and copy-paste the following code into it:
<html> <head> <title>Test web page!</title> </head> <body> <p>Chapeau! your assets are available online.</p> </body> </html>
3. Install the ScaleDynamics SDK to access all CLI commands
To install the SDK you need Node.js installed on your computer. Look at https://nodejs.org/en/download/ to install it.
Install the SDK to access all CLI commands:
npm install warp --save-dev
To access our CLI, use
npx warp. You can have the list of available commands and help with
npx warp help
4. Create the project and the environment
The deployment of a static assets requires to indicate in which project and which environment you want to deploy them.
A project is a name that identifies a web site, a web app, a microservice or an API.
An environment is a name that identifies a cloud execution configuration to serve your assets. For example you can have 'pre-prod', 'demo', 'staging' or 'production' environments. Each one will have it's own cloud resource configuration.
Login to your account
To access projects and deployment resources you need to log into your ScaleDynamics account:
npx warp login
Create a project
A project identifies a web site, a web app, a microservice or an API.
Let's create a
asset-test project, and let's indicate the SDK we are working in it.
npx warp project create asset-test npx warp project select asset-test
Create an environment
Let's create a
demo environment, and let's indicate the SDK we are working in it.
npx warp env create demo npx warp env select demo
5. Setup services for the environment
Before deploying you need to enable the Static asset hosting service and assign cloud resources to run it. To do that, open the console, select the organization, the server-test project and the demo environment. Then enable the Static asset hosting service and assign a Shared Free cloud resource on the provider and the region you choose.
After subscribing resources, you will see in the console your services configurations.
6. Deploy the server
Now you can deploy the assets. By default all files/directories in
public will be deployed and make accessible on https.
npx warp deploy
During the deployment, you will have to indicate the url you want to access your server after deployment.
✔ Enter a hostname for 'server' (fully qualified or not), leave blank for random: …
You can enter a name or press return to get a random one.
After deployment the url to serve your assets is dumped on the terminal.
if you want to know the deployment url, you can access the console or use the following command to get it:
npx warp env info
Now assets are deployed, let's access them on https: