cloudfoundry/sample-http-app

Name: sample-http-app

Owner: Cloud Foundry

Description: null

Created: 2018-03-07 19:16:58.0

Updated: 2018-04-16 23:12:29.0

Pushed: 2018-03-28 16:40:01.0

Homepage: null

Size: 17

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Sample HTTP Application

The sample HTTP application implements the correct shutdown behavior for an HTTP application deployed to Cloud Foundry. It adheres to the following contract when shutting down:

This application implements the connection management itself in main.go, but similar logic can be found in the Shutdown method of the Golang HTTP server.

Configure

The app is configurable by setting the following environment variables:

Response Latency

The response latency can be controlled by setting the query parameter wait to any string parseable by time.ParseDuration. The default value is 10 µs.

Deploy to Cloud Foundry

Simply run cf push from the app root directory and it should deploy successfully.

Run Locally

To run locally, follow the steps below:

et ./...
uild .
mple-http-app

To run the tests, first get the dependencies using go get -t ./... && go get github.com/onsi/ginkgo/ginkgo then run ginkgo in the app root directory.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.