Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swisscom/cf-sample-app-go-dep
A sample Go application to deploy to Cloud Foundry using dep
https://github.com/swisscom/cf-sample-app-go-dep
appcloud go-dep golang swisscom
Last synced: 25 days ago
JSON representation
A sample Go application to deploy to Cloud Foundry using dep
- Host: GitHub
- URL: https://github.com/swisscom/cf-sample-app-go-dep
- Owner: swisscom
- License: other
- Created: 2018-07-06T07:42:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-09T10:25:53.000Z (over 6 years ago)
- Last Synced: 2024-05-01T20:03:20.342Z (8 months ago)
- Topics: appcloud, go-dep, golang, swisscom
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 33
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# cf-sample-app-go-dep
A sample [Go](https://golang.org/) application to deploy to Cloud Foundry using
[dep](https://github.com/golang/dep)This basic example uses a custom router and serves 2 endpoints
`/health` and `/` it uses the environment var `VERSION` defined in the
[manifest.yml](manifest.yml) the one later is returned when querying the
`/health` endpoint.The application has the following structure:
|-- app
| `--hello
| `--hello.go
|-- health.go
|-- main.go
`-- manifest.yml# How to use it
Install and set your [GO environment](https://golang.org/doc/install)
For example using $HOME/go for your workspace
$ export GOPATH=$HOME/go
Create the directory:
$ mkdir -p $HOME/go/src/github.com/swisscom
Clone project into that directory:
$ git clone https://github.com/swisscom/cf-sample-app-go-dep.git $HOME/go/src/github.com/swisscom/cf-sample-app-go-dep
> [git](https://git-scm.com/) is required to clone the repository.
To test the app locally before deploying it in to app-cloud, build it by just typing make:
$ cd $HOME/go/src/github.com/swisscom/cf-sample-app-go-dep
$ makeAfter make finishes you can run the app:
$ ./cf-sample-app-go-dep
2018/07/06 13:39:12 Adding path: /health [ALL]
2018/07/06 13:39:12 Adding path: / [ALL]> This steps requires [dep](https://github.com/golang/dep)
Visit [http://localhost:8080](http://localhost:8080)
## Deploying the app to app-cloud
If you tested locally, remove the `vendor` directory or simply use:
$ make clean
Then just use:
$ cf push