<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Geoffrey GUILBON, Author at Clever Cloud</title>
	<atom:link href="https://www.clever.cloud/blog/author/geoffrey-guilbonclever-cloud-com/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>From Code to Product</description>
	<lastBuildDate>Tue, 25 Mar 2025 15:01:10 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://cdn.clever-cloud.com/uploads/2023/03/cropped-cropped-favicon-32x32.png</url>
	<title>Geoffrey GUILBON, Author at Clever Cloud</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Deploy a Scala / Akka application with PostgreSQL integration</title>
		<link>https://www.clever.cloud/blog/engineering/2022/06/09/deploy-a-scala-akka-application-with-postgresql-integration/</link>
		
		<dc:creator><![CDATA[Geoffrey GUILBON]]></dc:creator>
		<pubDate>Thu, 09 Jun 2022 12:44:32 +0000</pubDate>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[Scala]]></category>
		<guid isPermaLink="false">https://www.clever-cloud.com/?p=6509</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2022/06/akka.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="akka" decoding="async" fetchpriority="high" srcset="https://cdn.clever-cloud.com/uploads/2022/06/akka.png 1400w, https://cdn.clever-cloud.com/uploads/2022/06/akka-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2022/06/akka-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2022/06/akka-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2022/06/akka-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><!-- wp:media-text {"align":"wide","mediaId":6749,"mediaType":"image","mediaWidth":30} -->
<div class="wp-block-media-text alignwide is-stacked-on-mobile" style="grid-template-columns:30% auto"><figure class="wp-block-media-text__media"><img src="https://cdn.clever-cloud.com/uploads/2022/06/akkatoolkitlogo-2-318x131.png" alt="" class="wp-image-6749 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph -->
<p>When I started working at Clever Cloud, I spent some time messing around with the platform and its tooling. This blog post will present you how I managed to:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>create a simple Scala/Akka HTTP template application with PostgreSQL persistence</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>link the application to a managed PostgreSQL</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>deploy it</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>try it!</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></div></div>
<!-- /wp:media-text -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Create a Scala/Akka HTTP template 🔨</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Get the sources</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><a href="https://github.com/CleverCloud/scala-akka-http-postgres-example">Clone</a> the project generated from Akka Github <a href="https://github.com/akka/akka-http-quickstart-scala.g8" target="_blank" rel="noreferrer noopener">quick start template</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This service provides the ability to manage a simple in-memory user registry exposing 4 routes:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>List all users</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Get a specific user</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Create a user</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Delete a user</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>A thorough description of available the cURL commands may be found <a href="https://developer.lightbend.com/guides/akka-http-quickstart-scala/#cURL-commands" target="_blank" rel="noreferrer noopener">here</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Add extra features</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>A few functionalities have been added on top of the original example:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>store the registry into a PostgreSQL database (instead of in memory)</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>read database parameters from <a href="https://www.clever.cloud/blog/fonctionnalites/2022/03/22/improving-our-environment-variables-editor/">environment variables</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>add a hardcoded basic authentication</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>All parameters may be specified in the <a href="https://github.com/CleverCloud/scala-akka-http-postgres-example/blob/master/src/main/resources/application.conf">application.conf</a> file:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>basic auth</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>database parameters</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>Parameters are fetched from environment variables, or the specified default value if none is found</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">app {
  basic-auth {
    user = "foo"
    user = ${?BASIC_AUTH_USER}
    password = "bar"
    password = ${?BASIC_AUTH_PASSWORD}
  }
  routes {
    # If ask takes more time than this to complete the request is failed
    ask-timeout = 5s
  }

  db {
    host = "localhost"
    host = ${?POSTGRESQL_ADDON_HOST}
    port = "5432"
    port = ${?POSTGRESQL_ADDON_PORT}
    database = "postgres"
    database = ${?POSTGRESQL_ADDON_DB}
    user = "login"
    user = ${?POSTGRESQL_ADDON_USER}
    pass = "pass"
    pass = ${?POSTGRESQL_ADDON_PASSWORD}
  }
}</code></pre>
<!-- /wp:html -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Run the application using Clever Cloud CLI 🚀</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Create a Clever Cloud application</h3>
<!-- /wp:heading -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever create --type sbt myakka --region par --org testorg</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>This command creates a new application</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>of type sbt for <a href="https://www.clever.cloud/product/applications-scala/">Scala</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>named <em>myakka</em></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>in <em>Paris</em> region</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>inside my test organisation <em>testorg</em></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Enable a dedicated build instance for faster build (optional pro tip)</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>By default a newly created application will run an XS instance which are quite small for building Scala applications fast. One way to build faster is to use a dedicated build Instance: In the Clever Cloud console, got to your application -&gt; options, and check the box <code>[] Enable dedicated build instance</code> This way you can keep your XS instance for running the application, but you can choose an XL for the build time. Or with the command line tool:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever scale -a myakka --build-flavor XL</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Create a PostgreSQL database</h3>
<!-- /wp:heading -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever addon -l myakka create postgresql-addon myakkadb</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>This command orders a PostgreSQL add-on instance and link it to <code><em>myakka</em></code>, injecting the right environment variables into the application instance to contact the database.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Database creation and migration is performed using <a href="https://flywaydb.org/">flywaydb</a> tool. Those script may be found in the <a href="https://github.com/CleverCloud/scala-akka-http-postgres-example/tree/master/src/main/resources/db/migration">migration/db</a> directory of the application resources.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Migration will be automatically called once you specify the proper build hook in the environment variables</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><kbd>CC_POST_BUILD_HOOK</kbd> with value <kbd><kbd>sbt flywayMigrate</kbd></kbd></p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever env -a myakka set <kbd>CC_POST_BUILD_HOOK</kbd> "sbt flywayMigrate"</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Configure basic auth environment variables</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Basic authentication login and password can be specified as environment variables using the <kbd>clever env</kbd> command. If none is found, basic authentication will default to <em>application.conf</em> file values</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever env -a myakka set BASIC_AUTH_USER &lt;YOUR_AUTH_USER&gt;
clever env -a myakka set BASIC_AUTH_PASSWORD &lt;YOUR_AUTH_PASSWORD&gt;</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Link your local repo with your Clever Cloud application instance</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Retrieve your application id with</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever applications</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Then link the local repository to the application (creating a <em>.clever.json</em> file)</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever link app_&lt;UUID&gt;</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Deploy</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>You are now ready to deploy and run your code, just run</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever deploy</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>You are now able to follow the deployment process until it completes successfully</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Your application is running now!</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Try it</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>It's time to experiment with it using <kbd>curl</kbd> or your favorite GUI</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">Add a user</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Adapt this command in order to insert a new user into the registry:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">curl --request POST \
  --url https://app-&lt;UUID&gt;.cleverapps.io/users \
  --header 'Content-type: application/json' \
  -u '&lt;YOUR_AUTH_USER&gt;:&lt;YOUR_AUTH_PASSWORD&gt;' \
  --data '{
  "name": "Serge",
  "age": 42,
  "countryOfResidence": "Greenland"
}'

{
	"description": "User Serge created."
}</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">Get all users</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Check that the user has been properly created, by getting the list of users:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">curl --request GET \
  --url https://app-&lt;UUID&gt;.cleverapps.io/users \
  -u '&lt;YOUR_AUTH_USER&gt;:&lt;YOUR_AUTH_PASSWORD&gt;'

{"users":[{"age":42,"countryOfResidence":"Greenland","name":"Serge"}]}</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>It works, Success! 🎉</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2022/06/akka.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="akka" decoding="async" srcset="https://cdn.clever-cloud.com/uploads/2022/06/akka.png 1400w, https://cdn.clever-cloud.com/uploads/2022/06/akka-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2022/06/akka-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2022/06/akka-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2022/06/akka-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><!-- wp:media-text {"align":"wide","mediaId":6749,"mediaType":"image","mediaWidth":30} -->
<div class="wp-block-media-text alignwide is-stacked-on-mobile" style="grid-template-columns:30% auto"><figure class="wp-block-media-text__media"><img src="https://cdn.clever-cloud.com/uploads/2022/06/akkatoolkitlogo-2-318x131.png" alt="" class="wp-image-6749 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph -->
<p>When I started working at Clever Cloud, I spent some time messing around with the platform and its tooling. This blog post will present you how I managed to:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>create a simple Scala/Akka HTTP template application with PostgreSQL persistence</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>link the application to a managed PostgreSQL</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>deploy it</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>try it!</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></div></div>
<!-- /wp:media-text -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Create a Scala/Akka HTTP template 🔨</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Get the sources</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><a href="https://github.com/CleverCloud/scala-akka-http-postgres-example">Clone</a> the project generated from Akka Github <a href="https://github.com/akka/akka-http-quickstart-scala.g8" target="_blank" rel="noreferrer noopener">quick start template</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This service provides the ability to manage a simple in-memory user registry exposing 4 routes:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>List all users</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Get a specific user</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Create a user</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Delete a user</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>A thorough description of available the cURL commands may be found <a href="https://developer.lightbend.com/guides/akka-http-quickstart-scala/#cURL-commands" target="_blank" rel="noreferrer noopener">here</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Add extra features</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>A few functionalities have been added on top of the original example:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>store the registry into a PostgreSQL database (instead of in memory)</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>read database parameters from <a href="https://www.clever.cloud/blog/fonctionnalites/2022/03/22/improving-our-environment-variables-editor/">environment variables</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>add a hardcoded basic authentication</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>All parameters may be specified in the <a href="https://github.com/CleverCloud/scala-akka-http-postgres-example/blob/master/src/main/resources/application.conf">application.conf</a> file:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>basic auth</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>database parameters</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>Parameters are fetched from environment variables, or the specified default value if none is found</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">app {
  basic-auth {
    user = "foo"
    user = ${?BASIC_AUTH_USER}
    password = "bar"
    password = ${?BASIC_AUTH_PASSWORD}
  }
  routes {
    # If ask takes more time than this to complete the request is failed
    ask-timeout = 5s
  }

  db {
    host = "localhost"
    host = ${?POSTGRESQL_ADDON_HOST}
    port = "5432"
    port = ${?POSTGRESQL_ADDON_PORT}
    database = "postgres"
    database = ${?POSTGRESQL_ADDON_DB}
    user = "login"
    user = ${?POSTGRESQL_ADDON_USER}
    pass = "pass"
    pass = ${?POSTGRESQL_ADDON_PASSWORD}
  }
}</code></pre>
<!-- /wp:html -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Run the application using Clever Cloud CLI 🚀</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Create a Clever Cloud application</h3>
<!-- /wp:heading -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever create --type sbt myakka --region par --org testorg</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>This command creates a new application</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>of type sbt for <a href="https://www.clever.cloud/product/applications-scala/">Scala</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>named <em>myakka</em></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>in <em>Paris</em> region</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>inside my test organisation <em>testorg</em></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Enable a dedicated build instance for faster build (optional pro tip)</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>By default a newly created application will run an XS instance which are quite small for building Scala applications fast. One way to build faster is to use a dedicated build Instance: In the Clever Cloud console, got to your application -&gt; options, and check the box <code>[] Enable dedicated build instance</code> This way you can keep your XS instance for running the application, but you can choose an XL for the build time. Or with the command line tool:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever scale -a myakka --build-flavor XL</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Create a PostgreSQL database</h3>
<!-- /wp:heading -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever addon -l myakka create postgresql-addon myakkadb</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>This command orders a PostgreSQL add-on instance and link it to <code><em>myakka</em></code>, injecting the right environment variables into the application instance to contact the database.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Database creation and migration is performed using <a href="https://flywaydb.org/">flywaydb</a> tool. Those script may be found in the <a href="https://github.com/CleverCloud/scala-akka-http-postgres-example/tree/master/src/main/resources/db/migration">migration/db</a> directory of the application resources.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Migration will be automatically called once you specify the proper build hook in the environment variables</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><kbd>CC_POST_BUILD_HOOK</kbd> with value <kbd><kbd>sbt flywayMigrate</kbd></kbd></p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever env -a myakka set <kbd>CC_POST_BUILD_HOOK</kbd> "sbt flywayMigrate"</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Configure basic auth environment variables</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Basic authentication login and password can be specified as environment variables using the <kbd>clever env</kbd> command. If none is found, basic authentication will default to <em>application.conf</em> file values</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever env -a myakka set BASIC_AUTH_USER &lt;YOUR_AUTH_USER&gt;
clever env -a myakka set BASIC_AUTH_PASSWORD &lt;YOUR_AUTH_PASSWORD&gt;</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Link your local repo with your Clever Cloud application instance</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Retrieve your application id with</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever applications</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Then link the local repository to the application (creating a <em>.clever.json</em> file)</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever link app_&lt;UUID&gt;</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Deploy</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>You are now ready to deploy and run your code, just run</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever deploy</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>You are now able to follow the deployment process until it completes successfully</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Your application is running now!</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Try it</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>It's time to experiment with it using <kbd>curl</kbd> or your favorite GUI</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">Add a user</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Adapt this command in order to insert a new user into the registry:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">curl --request POST \
  --url https://app-&lt;UUID&gt;.cleverapps.io/users \
  --header 'Content-type: application/json' \
  -u '&lt;YOUR_AUTH_USER&gt;:&lt;YOUR_AUTH_PASSWORD&gt;' \
  --data '{
  "name": "Serge",
  "age": 42,
  "countryOfResidence": "Greenland"
}'

{
	"description": "User Serge created."
}</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">Get all users</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Check that the user has been properly created, by getting the list of users:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">curl --request GET \
  --url https://app-&lt;UUID&gt;.cleverapps.io/users \
  -u '&lt;YOUR_AUTH_USER&gt;:&lt;YOUR_AUTH_PASSWORD&gt;'

{"users":[{"age":42,"countryOfResidence":"Greenland","name":"Serge"}]}</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>It works, Success! 🎉</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
