Deploy your First Application
Now let’s deploy your first application using Hippo!
Since we will be writing our application in Rust, we will need to install Rust.
Make sure to have the
wasm32-wasi target available:
$ rustup target add wasm32-wasi
yo-wasm generates new projects to be used with Hippo.
First, install Yeoman using
npm. Then install
$ npm install -g yo $ npm install -g generator-wasm
Register an Account
Open your web browser to https://localhost:5001 and accept the self-signed certificate to view the Hippo Web UI.
Click “Register” and create a new account. Use “admin” for the username, enter your email address, and use “Passw0rd!” for your password - we’ll reference these later when logging in with the Hippo CLI.
Create an Application
Now go back to your terminal and use
yo wasm to generate your application. To
auto-populate some fields, you can set up a few environment variables ahead of
Note: We need to disable strict SSL certificate checking because our Hippo server is using a self-signed certificate.
$ export USER=admin $ export HIPPO_USERNAME=admin $ export HIPPO_PASSWORD='Passw0rd!' $ export HIPPO_URL=https://localhost:5001 $ export BINDLE_URL=http://localhost:8080/v1 $ export GLOBAL_AGENT_FORCE_GLOBAL_AGENT=false
Create a new directory for your application.
$ mkdir helloworld $ cd $_
yo wasm, answering the questions to generate your application.
$ yo wasm ? What is the name of the WASM module? helloworld ? What type of application is the module? Web service or application using WAGI ? What is the name of the author? Matthew Fisher ? What programming language will you write the module in? Rust ? Where do you plan to publish the module? Hippo ? Would you like to install build tools (Rust WASI target)? Yes ? What is the URL of your Hippo service? https://localhost:5001 ? What is the URL of your Hippo's Bindle server? http://localhost:8080/v1 ? Would you like to create a new Hippo application for this project? Yes ? What storage ID (bindle name) would you like for your Hippo app? admin/helloworld ? What domain name would you like for your Hippo app? helloworld.hippofactory.io ? Enter your Hippo user name (will become app owner) admin ? Enter your Hippo password *********
Open your web browser to https://localhost:5001, accept the self-signed certificate, and log in. You should see an application named “helloworld” in the list.
At this point, your application is registered with Hippo, but it is not yet being served. You need to first compile the application, package it into a bindle, and then push it to the Bindle server. Then Hippo will discover the new version and deploy it.
Compile your application to WebAssembly with WASI support.
$ cargo build --release --target wasm32-wasi
Run your application locally to try it out. It should print “Hello, world!”
$ cargo run
To push your application to Bindle, use the
$ hippo push -k .
Open your web browser to https://admin.helloworld.hippofactory.io:5003 and accept the self-signed certificate. You should see “Hello, world!”.
Congratulations! You just deployed your first application to Hippo!
The beginner tutorial ends here. In the meantime, you might want to check out some pointers on where to go from here.