From 27123a0609f5a90f96485c45c2f20219bcea8944 Mon Sep 17 00:00:00 2001 From: Travis Reeder Date: Mon, 6 Feb 2017 07:12:29 -0800 Subject: [PATCH] Updated API index reponse, more friendly. (#511) --- api/server/ping.go | 2 +- build.ps1 | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/api/server/ping.go b/api/server/ping.go index a00ae0502..e0d0735a4 100644 --- a/api/server/ping.go +++ b/api/server/ping.go @@ -7,5 +7,5 @@ import ( ) 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"}) } diff --git a/build.ps1 b/build.ps1 index 2c4057c55..9f928fbc9 100644 --- a/build.ps1 +++ b/build.ps1 @@ -4,6 +4,22 @@ $ErrorActionPreference = "Stop" $cmd = $args[0] 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 () { 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 . @@ -15,6 +31,7 @@ function run () { switch ($cmd) { + "quick" {quick} "build" { build } "run" {run} default {"Invalid command: $cmd"}