Updated API index reponse, more friendly. (#511)

This commit is contained in:
Travis Reeder
2017-02-06 07:12:29 -08:00
committed by Seif Lotfy سيف لطفي
parent 679d50602e
commit 27123a0609
2 changed files with 18 additions and 1 deletions

View File

@@ -7,5 +7,5 @@ import (
) )
func handlePing(c *gin.Context) { func handlePing(c *gin.Context) {
c.JSON(http.StatusNotImplemented, "Not Implemented") c.JSON(http.StatusOK, gin.H{"hello": "world!", "goto": "https://github.com/iron-io/functions"})
} }

View File

@@ -4,6 +4,22 @@ $ErrorActionPreference = "Stop"
$cmd = $args[0] $cmd = $args[0]
Write-Host "cmd: $cmd" Write-Host "cmd: $cmd"
function quick() {
try {
go build
if (-not $?) {
Write-Host "build failed!" # WTH, error handling in powershell sucks
exit
}
} catch {
# This try/catch thing doesn't work, the above if statement does work though
Write-Host "build failed 2!"
exit
}
./functions
}
function build () { function build () {
docker run --rm -v ${pwd}:/go/src/github.com/iron-io/functions -w /go/src/github.com/iron-io/functions iron/go:dev go build -o functions-alpine docker run --rm -v ${pwd}:/go/src/github.com/iron-io/functions -w /go/src/github.com/iron-io/functions iron/go:dev go build -o functions-alpine
docker build -t iron/functions:latest . docker build -t iron/functions:latest .
@@ -15,6 +31,7 @@ function run () {
switch ($cmd) switch ($cmd)
{ {
"quick" {quick}
"build" { build } "build" { build }
"run" {run} "run" {run}
default {"Invalid command: $cmd"} default {"Invalid command: $cmd"}