Move hello-async.sh and hello-sync.sh to the ruby and go directories … (#176)

* Move hello-async.sh and hello-sync.sh to the ruby and go directories and get rid of examples in tools

* update hello-ruby code to use iron/hello:ruby images
This commit is contained in:
Seif Lotfy سيف لطفي
2016-10-17 22:12:10 +02:00
committed by GitHub
parent 0270eca460
commit 7ec037b46a
8 changed files with 46 additions and 21 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -1 +0,0 @@
/hello

View File

@@ -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"]

View File

@@ -1 +0,0 @@
0.0.1

View File

@@ -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))
}