> For the complete documentation index, see [llms.txt](https://docs.rumi.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rumi.systems/rumi-cli/commands/quickstart/webservice.md).

# webservice

Generate a Webservice microservice (an HTTP front door onto the Rumi engine).

## Syntax

```bash
rumi quickstart webservice [options]
```

## Options

| Option        | Short | Description                       | Default           |
| ------------- | ----- | --------------------------------- | ----------------- |
| `--app-root`  | `-r`  | Application root directory        | `rumi-quickstart` |
| `--clustered` | `-c`  | Create the microservice clustered | `false`           |

## Example

```bash
rumi quickstart webservice --app-root my-app
```

## What Gets Generated

The webservice is stateful and clusterable, and embeds an HTTP server that hands requests to the engine and waits for the reply. The generated module contains:

| File                           | Purpose                                       |
| ------------------------------ | --------------------------------------------- |
| `Main.java`                    | The microservice, carrying its `@AppHAPolicy` |
| `HttpServer.java`              | The embedded HTTP server                      |
| `AepEngineProvider.java`       | Supplies the engine to the web layer          |
| `resources/WebMain.java`       | The HTTP resource, where you add endpoints    |
| `models/api.xml`               | API operations                                |
| `models/messages/messages.xml` | Message model                                 |
| `models/state/state.xml`       | State model                                   |

The HTTP port is wired into the system configuration and defaults to `8080`:

```xml
<port>${quickstart.local.webservice.http.port::8080}</port>
```

Like the [processor](/rumi-cli/commands/quickstart/processor.md), [driver](/rumi-cli/commands/quickstart/driver.md), and [connector](/rumi-cli/commands/quickstart/connector.md) quickstart microservices, the generated code is scaffolding: `WebMain` is where you add your endpoints, and the handlers that service them go in `Main`.

## Clustering

The webservice is clusterable, so it always carries an HA model. It is generated **non-clustered** by default, which keeps the quickstart to a single container per microservice while you are learning. Pass `--clustered` to generate it as a clustered microservice with a hot standby, the same shape the [processor](/rumi-cli/commands/quickstart/processor.md) uses.

## See Also

* [app](/rumi-cli/commands/quickstart/app.md) - Generate a complete application
* [processor](/rumi-cli/commands/quickstart/processor.md) - Generate a Processor microservice
* [driver](/rumi-cli/commands/quickstart/driver.md) - Generate a Driver microservice
* [connector](/rumi-cli/commands/quickstart/connector.md) - Generate a Connector microservice
