Skip to content

Commit 6283570

Browse files
committed
initial commit
0 parents  commit 6283570

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

.github/workflows/go.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
- name: Set up Go
18+
uses: actions/setup-go@v3
19+
with:
20+
go-version: 1.18
21+
- name: Release
22+
uses: softprops/[email protected]
23+
if: startsWith(github.ref, 'refs/tags/')

app.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package hello
2+
3+
import (
4+
"github.com/go-gorf/gorf"
5+
)
6+
7+
func setup() error {
8+
// Add setup here
9+
return nil
10+
}
11+
12+
var HelloApp = gorf.GorfBaseApp{
13+
Name: "Hello",
14+
RouteHandler: Urls,
15+
SetUpHandler: setup,
16+
}

urls.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package hello
2+
3+
import "github.com/gin-gonic/gin"
4+
5+
func Urls(r *gin.Engine) {
6+
r.POST("/hello", Hello)
7+
}

views.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package hello
2+
3+
import (
4+
"net/http"
5+
6+
"github.com/gin-gonic/gin"
7+
)
8+
9+
func Hello(ctx *gin.Context) {
10+
ctx.JSON(http.StatusOK, gin.H{
11+
"message": "Hello world",
12+
})
13+
}

0 commit comments

Comments
 (0)