-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.go
33 lines (26 loc) · 1 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"net/http"
"github.com/gin-gonic/gin"
)
// activity is a Sandbox activity.
type activity struct {
Title string `json:"title"`
URL string `json:"url"`
}
// list of activities.
var activities = []activity{
{Title: "More activities)", URL: "https://developers.redhat.com/developer-sandbox/activities"},
{Title: "Create an OpenShift Serverless function", URL: "https://developers.redhat.com/developer-sandbox/activities/create-openshift-serverless-function"},
{Title: "Deploy a Java Application on Kubernetes in minutes", URL: "https://developers.redhat.com/developer-sandbox/activities/how-to-deploy-java-application-in-kubernetes"},
{Title: "Learn Kubernetes", URL: "https://developers.redhat.com/developer-sandbox/activities/learn-kubernetes-using-red-hat-developer-sandbox-openshift"},
}
// list as JSON
func getActivities(c *gin.Context) {
c.IndentedJSON(http.StatusOK, activities)
}
func main() {
router := gin.Default()
router.GET("/", getActivities)
router.Run("0.0.0.0:8080")
}