Initial Commit to Add RestAPI Server to IEC
[iec.git] / src / foundation / api / apiserver / app / controllers / app.go
diff --git a/src/foundation/api/apiserver/app/controllers/app.go b/src/foundation/api/apiserver/app/controllers/app.go
new file mode 100644 (file)
index 0000000..50435b1
--- /dev/null
@@ -0,0 +1,27 @@
+package controllers
+
+import (
+       "github.com/revel/revel"
+)
+
+type App struct {
+       *revel.Controller
+}
+
+func (c App) Index() revel.Result {
+       return c.Render()
+}
+
+// IecStatus represents the working status of IEC
+// This structure is required by revel test cmd.
+type IecStatus struct {
+       Status         string
+       Passed       bool
+       // ErrorHTML    template.HTML
+       // ErrorSummary string
+}
+
+func (c App) GetStatus() revel.Result {
+       status := IecStatus{Status: "ok", Passed: true}
+       return c.RenderJSON(status)
+}