Skip to content

Commit

Permalink
Make webapp-runner the standard
Browse files Browse the repository at this point in the history
  • Loading branch information
earldouglas committed Oct 10, 2024
1 parent 6a3e5bd commit 5faeb93
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ name [My Web Project]: hello sbt-war
Template applied in ./hello-sbt-war
$ cd hello-sbt-war/
$ sbt
> webappStart
```
Expand Down Expand Up @@ -110,22 +109,22 @@ class MyServlet extends HttpServlet:
res.getWriter.write("""<h1>Hello, world!</h1>""")
```

Run it from sbt with `warStart`:
Run it from sbt with `webappStart`:

```
$ sbt
> warStart
> webappStart
```

```
$ curl localhost:8080/hello
<h1>Hello, world!</h1>
```

Stop it with `warStop`:
Stop it with `webappStop`:

```
> warStop
> webappStop
```

Create a .war file with `package`:
Expand All @@ -152,12 +151,12 @@ Create a .war file with `package`:

| Key | Notes |
| ------------- | ----------------------------------------------------------------------- |
| `warStart` | Starts a local container, serving content from the packaged .war file |
| `warJoin` | Blocks until the container shuts down |
| `warStop` | Shuts down the container |
| `webappStart` | Starts a local container, serving content directly from project sources |
| `webappJoin` | Blocks until the container shuts down |
| `webappStop` | Shuts down the container |
| `warStart` | Starts a local container, serving content from the packaged .war file |
| `warJoin` | Blocks until the container shuts down |
| `warStop` | Shuts down the container |

### `war` vs. `webapp`

Expand Down Expand Up @@ -329,39 +328,39 @@ webappForkOptions :=
)
```

### `warStart` and `webappStart`
### `webappStart` and `warStart`

```
> warStart
> webappStart
```

```
> webappStart
> warStart
```

### `warJoin` and `webappJoin`
### `webappJoin` and `warJoin`

To block sbt while the container is running, use `warJoin`/`webappJoin`:
These can be used to block sbt while the container is running:

```
$ sbt warStart warJoin
$ sbt webappStart webappJoin
```

```
$ sbt webappStart webappJoin
$ sbt warStart warJoin
```

This is useful for running sbt in production (e.g. in a Docker
container), if you're into that kind of thing.

### `warStop` and `webappStop`
### `webappStop` and `warStop`

Stop the running container with `warStop`/`webappStop`:
These can be used to stop the running container:

```
> warStop
> webappStop
```

```
> webappStop
> warStop
```

0 comments on commit 5faeb93

Please sign in to comment.