# Sample App - a simple Go webapp

### Pushing the app to Gstack

```
gk push test-app
```

### Endpoints

- `/`: a simple landing page displaying the index and uptime
- `/env`: displays environment variables
- `/exit`: instructs the app to exit with status code 1
- `/port`: returns the local port the request was received on

### Configure the app to listen on multiple ports

By providing a customer start command, you can configure the app to listen on multiple ports. The app responds the same way to each port.
```
cf push test-app -c "test-app --ports=7777,8888"
```

### Pushing the app to Gstack as a Docker image

Sample App is also packaged as a docker image at gstackio/sample-app

```bash
cf push wow-cool -o gstackio/sample-app -d <my-family-name>.gstack.io
```

<small>
→ where `<my-family-name>` is to be replaced by your own family name.
</small>

### To rebuild the dockerimage:

```bash
./build.sh
```

Assumes you have the go toolchain (with the ability to cross-compile to different platforms) and docker installed and pointing at your docker daemon.

# Sample App - a simple Go webapp

### Pushing the app to Gstack

```
gk push test-app
```

### Endpoints

- `/`: a simple landing page displaying the index and uptime
- `/env`: displays environment variables
- `/exit`: instructs the app to exit with status code 1
- `/port`: returns the local port the request was received on

### Configure the app to listen on multiple ports

By providing a customer start command, you can configure the app to listen on multiple ports. The app responds the same way to each port.
```
cf push test-app -c "test-app --ports=7777,8888"
```

### Pushing the app to Gstack as a Docker image

Sample App is also packaged as a docker image at gstackio/sample-app

```bash
cf push wow-cool -o gstackio/sample-app -d <my-family-name>.gstack.io
```

→ Where `<my-family-name>` is to be replaced by your own family name.

### To rebuild the dockerimage:

```bash
./build.sh
```

Assumes you have the go toolchain (with the ability to cross-compile to different platforms) and docker installed and pointing at your docker daemon.

Remove <small> that is not supported on Github
Remove <small> that is not supported on Github
