feat: hello world
This commit is contained in:
		
							
								
								
									
										24
									
								
								cmd/howmuch/main.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								cmd/howmuch/main.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,24 @@
 | 
			
		||||
package main
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"net/http"
 | 
			
		||||
 | 
			
		||||
	"github.com/gin-gonic/gin"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const port = 8080
 | 
			
		||||
 | 
			
		||||
func main() {
 | 
			
		||||
	fmt.Println("How much do I owe you?")
 | 
			
		||||
 | 
			
		||||
	r := gin.Default()
 | 
			
		||||
 | 
			
		||||
	r.GET("/", func(ctx *gin.Context) {
 | 
			
		||||
		ctx.JSON(http.StatusOK, gin.H{
 | 
			
		||||
			"message": "how much?",
 | 
			
		||||
		})
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	r.Run(fmt.Sprintf(":%d", port))
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user