⚡
Boltz
  • Boltz
  • Install
  • Hello World
  • Express
  • How Endpoints Work
Powered by GitBook
On this page
  • Create your Instance
  • Create your volume
  • Putting it all together

Was this helpful?

Hello World

You can setup a Hello World function with just a few files, an instance, and a volume.

Create your Instance

In the navbar click instances, and then create instance. It will prompt you for a name, enter hello-world This will be the name of the route that will go to this instance.

Create your volume

Go back to the navbar and click volumes. Then create a new volume and name it hello-world-app. Then copy these files to the volume, by creating each file and then copying its contents.

exports.request = (req, res) => {
    res.statusCode = 200;
    res.write('Hello World!');
    res.end();
}
{
    "main": "/index.js"
}

Finally press Save Volume to publish these files to the volume.

Putting it all together

Finally you can go back to instances, click your instance, press mount volume, and select hello-world-app. Once you've mounted the instance click Endpoint. This will bring you to a page that connects to a Node VM running your code, and you should see Hello World!

For a more advanced example, you should try to add express.js to your endpoint with this page:

PreviousInstallNextExpress

Last updated 3 years ago

Was this helpful?