Quickstart: Deploy prebuilt examples

Before you begin

  • If you’re new to Akka Serverless, create an account so you can try out Akka Serverless for free.

  • You’ll also need install the Akka Serverless CLI if you want to deploy from a command line.

Deploying the sample

Akka Serverless has several ready made sample applications for you to try out! In the table below you can see the available samples and the container image URL you’ll need if you want to deploy that sample. Clicking on the language will take you to the GitHub repository with the source code.

Sample Container image URL

A shopping cart based on a Value Entity (Key/Value store)

JavaScript: gcr.io/akkaserverless-public/samples-js-value-entity-shopping-cart:0.0.3

Java: gcr.io/akkaserverless-public/samples-java-value-entity-shopping-cart:0.0.1

A shopping cart based on an Event Sourced Entity

JavaScript: gcr.io/akkaserverless-public/samples-js-event-sourced-shopping-cart:0.0.1

Java: gcr.io/akkaserverless-public/samples-java-event-sourced-shopping-cart:0.0.1

  1. Log into your account:

    akkasls auth login
  2. Choose the sample you want to deploy from the above table and run:

    akkasls services deploy <name> <Container image URL from above table>
  3. To get an HTTP endpoint and enable CORS run:

    akkasls services expose <name> --enable-cors

Invoke your service

If you have deployed your service using the Akka Serverless CLI do these three steps first:

  1. Sign in to your Akka Serverless account

  2. Click on the project you deployed your service to

  3. Click on your service in the "Services" section

Now that you have deployed your service, the next step is to invoke it using cURL

  1. From the "Service Explorer" click on the method you want to invoke

  2. Click on "cURL"

  3. In the bottom section of the dialog, fill in the values you want to send to your service

  4. In the top section of the dialog, click the "Copy to clipboard" button

  5. Open a new command line and paste the content you just copied