> For the complete documentation index, see [llms.txt](https://docs.poja.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.poja.io/examples/hello-world-but-straight-to-the-cloud.md).

# Hello world, but straight to the cloud

***

### Goal <a href="#goal" id="goal"></a>

We want to **host on Poja a Spring Boot** Application[^1] that exposes the `/hello` endpoint, for which it answers `... world!`.

### How-to in 2 steps <a href="#howto-in-2-steps" id="howto-in-2-steps"></a>

**Step 1: Create your application**

From the [Applications](https://console.poja.io/login) page, click on the **Create New** button, then:

1. Provide the **name** of the application
2. Provide the **Github account** where Poja will create the **Github repository** to put your **Poja-generated starter template**
3. Provide the **package name**, say `com.my.company`. The starter template code will be generated in that package.
4. Provide the name and description of the to-create Github repository. The repository name may differ from the application name.
5. **Save**. Wait. And voilà! Your application will be deployed automatically.

{% hint style="info" %}
/ping

Every generated starter template comes with a `/ping` endpoint. To test your deployment, go to the generated deployment URL, then `/ping` it… and it will `pong` !
{% endhint %}

<figure><img src="/files/FRnm2Cg0fSuabGYTfR1q" alt=""><figcaption></figcaption></figure>

<div align="left"><figure><img src="/files/5iOpt59Vlyw1fqpxA883" alt=""><figcaption></figcaption></figure></div>

**Step 2: Code your endpoint**

In the generated Poja starter template, controllers are located in `com.my.company.endpoint.rest.controller`

{% code title="Java" %}

```java
package com.my.company.endpoint.rest.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWorldController {

  @GetMapping("/hello")
  public String helloWorld() {
    return "... world!";
  }
}
```

{% endcode %}

{% hint style="danger" %}
Important !

Do not forget to properly format your code **before** pushing it the prod or preprod branch, otherwise, the deployment will fail\
**Windows:** run `.\format.bat`

**MacOS & Linux:** run `./format.sh`
{% endhint %}

To trigger a deployment, just **commit and push** the code to the **preprod branch** of the repository. Wait. And voilà!

<figure><img src="/files/3QvKOXDKncx3LbyjBIXY" alt=""><figcaption></figcaption></figure>

[^1]: In the context of Poja, refers to a Spring Boot codebase hosted on one Github repository and ready to be deployed into prod or preprod environment. Though the code can differ for both environments, as well as the data, we still refer to them as one single application.
