diff --git a/README.md b/README.md index 2f3662ebf..c5639699b 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,15 @@ And how about a [slackbot](https://github.com/treeder/slackbots/tree/master/gupp curl -H "Content-Type: application/json" -X POST -d '{"path":"/guppy","image":"treeder/guppy:0.0.2", "content_type": "application/json"}' http://localhost:8080/api/v1/apps/myapp/routes ``` -You'all also get a custom URL like this when in production. +### Using IronFunctions Hosted by Iron.io + +Simply point to https://functions.iron.io instead of localhost and add your Iron.io Authentication header (TODO: link), like this: + +```sh +curl -H "Authorization: Bearer IRON_TOKEN" -H "Content-Type: application/json" -X POST -d '{"name":"APP_NAME"}' https://functions.iron.io/api/v1/apps +``` + +And you'll get an ironfunctions.com host: ``` APP_NAME.ironfunctions.com/PATH diff --git a/api/api.go b/api/api.go index b5f95825e..8c737b76d 100644 --- a/api/api.go +++ b/api/api.go @@ -102,7 +102,7 @@ func (r *NewApp) ServeHTTP(w http.ResponseWriter, req *http.Request) { return } log.Infoln("registered app:", app) - v := map[string]interface{}{"app": app} + v := map[string]interface{}{"app": app, "msg": "App created successfully."} SendSuccess(w, "App created successfully.", v) } @@ -140,7 +140,8 @@ func NewRoute(w http.ResponseWriter, req *http.Request) { return } log.Infoln("Route created:", route) - fmt.Fprintln(w, "Route created successfully.") + v := map[string]interface{}{"url": fmt.Sprintf("http://%v%v", app.Dns, route.Path), "msg": "Route created successfully."} + SendSuccess(w, "Route created successfully.", v) } func getRoute(host string) (*Route, error) { diff --git a/api/version.go b/api/version.go index c9f8617d9..58b62165a 100644 --- a/api/version.go +++ b/api/version.go @@ -1,3 +1,3 @@ package api -const Version = "0.0.27" +const Version = "0.0.28"