Code Monkey home page Code Monkey logo

cf-sample-app-go-dep's Introduction

cf-sample-app-go-dep

A sample Go application to deploy to Cloud Foundry using 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 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

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 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
$ make

After 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

Visit 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

cf-sample-app-go-dep's People

Contributors

nbari avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.