# Changing the configuration without a restart

> Goal: add a route, tune a quota, serve a second API - without a restart and without losing a request.

Guide - Since version 0.1.0 - Flexway v1.6.3 - https://flexway.io/en/docs/operations-live-config/

> Operations guide: configure, deploy and observe the gateway. What the capability does, product side: [product guide](https://flexway.io/en/docs/product-overview/); calling it: [developer guide](https://flexway.io/en/docs/developer-overview/).

**Goal**: add a route, tune a quota, serve a second API - without a restart and without losing a
request.

**Command** - edit the file; the gateway reads `flexway.yaml` and its contracts again every 5 s
(`server.reload.interval`):

```bash
$EDITOR openapi.yaml
docker kill -s HUP flexway        # optional: take the change at once
```

A second API, on its own host, from its own contract:

```yaml
hosts:
  admin.example.com:
    default_upstream: backoffice
    contracts: [./admin.yaml]       # this host serves exactly this contract, nothing of openapi.yaml
```

**Check**: `/config` (admin port) shows a new `config_version`, a new `config_digest` (the semantic
digest `flexway validate` prints) and `last_reload.result: applied`.
A deliberate mistake - an upstream that does not exist - **replaces nothing**: the running
configuration keeps serving, `last_reload.result: rejected`, the cause in `last_reload.cause` and in
the log, once.

> Eight settings need a restart: `server.shutdown`, `server.reload`, `server.counters`,
> `server.shedding`, `server.in_flight`, `server.cache`, `server.tls` and `observability`. Changing one refuses the
> whole reload, naming the key. Requests in flight finish on the previous
> configuration, streams included.
