functions: 0.0.28 release

This commit is contained in:
Travis Reeder
2016-07-17 21:49:25 -07:00
parent a20ad9f4e1
commit c5abab9f15
3 changed files with 13 additions and 4 deletions

View File

@@ -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 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 APP_NAME.ironfunctions.com/PATH

View File

@@ -102,7 +102,7 @@ func (r *NewApp) ServeHTTP(w http.ResponseWriter, req *http.Request) {
return return
} }
log.Infoln("registered app:", app) 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) SendSuccess(w, "App created successfully.", v)
} }
@@ -140,7 +140,8 @@ func NewRoute(w http.ResponseWriter, req *http.Request) {
return return
} }
log.Infoln("Route created:", route) 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) { func getRoute(host string) (*Route, error) {

View File

@@ -1,3 +1,3 @@
package api package api
const Version = "0.0.27" const Version = "0.0.28"