Copy of Quickstart (no tabs, comments, code samples, or callout)
Follow the steps in this Quickstart guide to get up and running with Akamai Functions in less than two minutes. Akamai Functions is the platform for running Spin applications on Akamai Cloud.
Install Spin
Spin is an open-source project you can use to build, run, and deploy Spin applications. It's both a CLI tool and a runtime. It provides SDKs for a variety of programming languages, including, but not limited to, Rust, Go, JavaScript and TypeScript.
To find the Spin version installed on your machine run, spin --version.
Install the aka plugin for Spin
aka plugin for SpinTo interact with Akamai Functions, you need to install the Akamai Functions for Akamai Spin plugin, aka. Use this command to install the plugin.
If you’ve previously installed the aka plugin, take a moment to upgrade it to ensure compatibility with the latest features and fixes.
You can learn more about managing Spin plugins in this article.
Go to the aka spin command reference for a complete list of supported commands.
Install language specific tooling
With Spin you can build applications using a wide variety of different programming languages. This quickstart, contains instructions and samples for JavaScript, TypeScript and Rust.
Follow these instructions to install language specific tooling on your machine.
Go to, WebAssembly language support matrix for more information about the supported languages.
Create a new Spin application
Next we’ll prepare an application with Spin. There are code samples below for you to use, but you can write an app from scratch or use an existing template. The Spin Hub has many reference examples and templates. You can also find several code samples, sorted by use case in the Akamai Functions GitHub repo
Compile the application
Use the spin build command to compile your Spin app to WebAssembly.
Test the application locally
You can test your Spin apps on your local computer by using the spin up command anytime. The spin up command starts an HTTP server on your local machine (port 3000 by default) and instantiates and invokes your Spin application for every request sent to the endpoint.
If port
3000is already in use, you could set a different port by specifying the--listenflag. For example,spin up --listen 127.0.0.1:3001.
From within an separate terminal instance, you can use a tool like curl to send an HTTP request to your Spin app
You can terminate spin up at anytime, by pressing CTRL+C.
Login to Akamai Functions
To Login you need access to the public preview of Akamai Functions. If you haven’t already requested access, please complete the Onboarding form. The Akamai Functions team will review your request and follow up shortly.
Once you’ve installed the aka plugin for Spin, and you have access to the public preview you can login. You'll need your GitHub account information to login.
Click the link displayed as part of the output from the spin aka login command. Authenticate using your individual GitHub Account and authorize the spin CLI for interacting with your Akamai Functions account.
Deploy the application
You can use the spin aka deploy command to deploy the application to Akamai Functions.
The spin command runs using the Spin binary in your system path. It reads the Spin application definition file spin.toml in the current (hello-spin) directory to know what application to deploy. It will ask you for a name for the application and then it will ask for confirmation that you want to deploy.
Here's an example of a successful Spin application deployment on Akamai Functions.
You can CTRL+Click on the link in the terminal window to visit the web application you just deployed.
Congratulations, you’ve now deployed your first Spin application to Akamai Functions!
Updated about 2 hours ago
