diff --git a/tool/examples/hello-async.sh b/examples/hello-go/hello-async.sh similarity index 100% rename from tool/examples/hello-async.sh rename to examples/hello-go/hello-async.sh diff --git a/tool/examples/hello-sync.sh b/examples/hello-go/hello-sync.sh similarity index 100% rename from tool/examples/hello-sync.sh rename to examples/hello-go/hello-sync.sh diff --git a/examples/hello-ruby/hello-async.sh b/examples/hello-ruby/hello-async.sh new file mode 100755 index 000000000..d18bfa7b2 --- /dev/null +++ b/examples/hello-ruby/hello-async.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +HOST="${1:-localhost:8080}" +REQ="${2:-1}" + +curl -H "Content-Type: application/json" -X POST -d '{ + "app": { "name":"myapp" } +}' http://$HOST/v1/apps + +curl -H "Content-Type: application/json" -X POST -d '{ + "route": { + "type": "async", + "path":"/hello-async", + "image":"iron/hello:ruby" + } +}' http://$HOST/v1/apps/myapp/routes + +for i in `seq 1 $REQ`; +do + curl -H "Content-Type: application/json" -X POST -d '{ + "name":"Johnny" + }' http://$HOST/r/myapp/hello-async +done; \ No newline at end of file diff --git a/examples/hello-ruby/hello-sync.sh b/examples/hello-ruby/hello-sync.sh new file mode 100755 index 000000000..ff3d595f9 --- /dev/null +++ b/examples/hello-ruby/hello-sync.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +HOST="${1:-localhost:8080}" +REQ="${2:-1}" + +curl -H "Content-Type: application/json" -X POST -d '{ + "app": { "name":"myapp" } +}' http://$HOST/v1/apps + +curl -H "Content-Type: application/json" -X POST -d '{ + "route": { + "type": "sync", + "path":"/hello-sync", + "image":"iron/hello:ruby + } +}' http://$HOST/v1/apps/myapp/routes + +for i in `seq 1 $REQ`; +do + curl -H "Content-Type: application/json" -X POST -d '{ + "name":"Johnny" + }' http://$HOST/r/myapp/hello-sync +done; \ No newline at end of file diff --git a/tool/examples/hello/.gitignore b/tool/examples/hello/.gitignore deleted file mode 100644 index e92569d01..000000000 --- a/tool/examples/hello/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/hello diff --git a/tool/examples/hello/Dockerfile b/tool/examples/hello/Dockerfile deleted file mode 100644 index ee192de5a..000000000 --- a/tool/examples/hello/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM iron/go:dev - -ADD . /go/src/github.com/treeder/hello -WORKDIR /go/src/github.com/treeder/hello -RUN go build github.com/treeder/hello - -ENTRYPOINT ["/go/src/github.com/treeder/hello/hello"] diff --git a/tool/examples/hello/VERSION b/tool/examples/hello/VERSION deleted file mode 100644 index 8acdd82b7..000000000 --- a/tool/examples/hello/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.1 diff --git a/tool/examples/hello/hello.go b/tool/examples/hello/hello.go deleted file mode 100644 index 7cd96e4be..000000000 --- a/tool/examples/hello/hello.go +++ /dev/null @@ -1,12 +0,0 @@ -package main - -import ( - "os" - "fmt" - "io/ioutil" -) - -func main() { - bytes, _ := ioutil.ReadAll(os.Stdin) - fmt.Printf("Hello %v!\n", string(bytes)) -}