GithubHelp home page GithubHelp logo

cowweb's Introduction

COWWEB

Cosay Web API.

$ curl "http://localhost:8080/cowsay/say?message=Hello%20cowweb"
 ______________
< Hello cowweb >
 --------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||--WWW |
                ||     ||

How to build and run

gradle

Build a executable jar with dependencies and run localy.

Inatall gradle.

See the official documentation.

Clone this repository.

git clone https://github.com/hhiroshell/cowweb.git && cd cowweb

Build and run.

gradle build
java -jar build_local/dist/libs/cowweb-0.1.jar

Call the API.

You can call the API via localhost:8080 .

curl "http://localhost:8080/cowsay/say"

And you can specify a message using "message" query (special characters have to be URL encorded).

curl "http://localhost:8080/cowsay/say?message=hello%20cowweb"

Skaffold

Build a containized app and deploy to a kubernets cluster using skaffold.

Set up required CLIs

Set up kubectl, docker and skaffold.

And make sure you have access to a kuberentes cluster you want to deploy this app via kubectl. Typically you can use minikube for experimental use.

Clone this repository.

git clone https://github.com/hhiroshell/cowweb.git && cd cowweb

Call the API.

Skaffold builds containinzed app, and deploy to kubernets cluster automatically. As regards this repository, skaffold configured to skip pushing the container image to resistry. For details, see the configuration file skaffold.yaml.

skaffold run

Build and run

You can find the app runnig in a pod and be exporsed via a service in the namespace "cowweb-local-dev", You can get the IP and port like a command below.

export COWWEB_HOST=$(kubectl get pod -n cowweb-local-dev -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get service cowweb -n cowweb-local-dev -o 'jsonpath={.spec.ports[0].nodePort}')

Then, call the API via COWWEB_HOST.

curl "http://$COWWEB_HOST/cowsay/say?message=hello%20cowweb"

cowweb's People

Contributors

hhiroshell avatar takashi-tanaka 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.