working commit
This commit is contained in:
+5
-7
@@ -4,13 +4,11 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const (
|
||||
PathServiceHello = "/service/hello"
|
||||
)
|
||||
|
||||
var (
|
||||
pathRegexp = `{path:[a-zA-Z_][\-a-zA-Z0-9_\/\.%~]+}`
|
||||
fileOperPrefix = "/v3/file"
|
||||
filepathRegexp = `{path:[a-zA-Z_][\-a-zA-Z0-9_\/\.%~]+}`
|
||||
fileApiPrefix = `/v3/file`
|
||||
|
||||
PathFileExists = fmt.Sprintf("%s/%s", fileOperPrefix, pathRegexp)
|
||||
FileExistsPath = fmt.Sprintf("%s/%s", fileApiPrefix, filepathRegexp)
|
||||
|
||||
ServiceHelloPath = "/service/hello"
|
||||
)
|
||||
|
||||
@@ -43,8 +43,8 @@ func (svc *Service) Build() error {
|
||||
svc.logg.Infof("Service build ")
|
||||
|
||||
svc.rout = router.NewRouter()
|
||||
svc.rout.Get(PathServiceHello, svc.hand.SendHello)
|
||||
svc.rout.Get(PathFileExists, svc.hand.FileExists)
|
||||
svc.rout.Get(ServiceHelloPath, svc.hand.SendHello)
|
||||
svc.rout.Get(FileExistsPath, svc.hand.FileExists)
|
||||
|
||||
listenAddress := fmt.Sprintf("%s:%d", svc.address, svc.portnum)
|
||||
svc.listen, err = net.Listen(protocol, listenAddress)
|
||||
|
||||
Reference in New Issue
Block a user