Skip to content
/ srv Public

Internal library for communication with HTTP protocol for Golang application

Notifications You must be signed in to change notification settings

hokkung/srv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Srv

A library for communicate with HTTP protocol.

Installation

go get github.com/hokkung/srv

Getting Started

  1. Prepair a customizer to register a route
type ServerCustomizer struct {

}

func (c *ServerCustomizer) Register(s *server.Server) {
    s.Engine.GET("/ping", func(c *gin.Context) {
		c.JSON(http.StatusOK, gin.H{
			"message": "pong",
		})
	})
}
  1. Create a server and start
customizer := ServerCustomizer{}
server := server.NewServer(customizer)
s.Start()

Environment Configuration

Key Description Example
APP_SERVER_ADDR Port to start HTTP server :8080 (default)

About

Internal library for communication with HTTP protocol for Golang application

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages