URL shortening service (#99)

This commit is contained in:
Janos Dobronszki
2021-05-17 13:41:36 +01:00
committed by GitHub
parent cecabe336f
commit c4e9a5c9c1
12 changed files with 902 additions and 0 deletions

25
url-shortener/main.go Normal file
View File

@@ -0,0 +1,25 @@
package main
import (
"github.com/micro/services/url-shortener/handler"
pb "github.com/micro/services/url-shortener/proto"
"github.com/micro/micro/v3/service"
"github.com/micro/micro/v3/service/logger"
)
func main() {
// Create service
srv := service.New(
service.Name("url-shortener"),
service.Version("latest"),
)
// Register handler
pb.RegisterUrlShortenerHandler(srv.Server(), handler.NewUrlShortener())
// Run service
if err := srv.Run(); err != nil {
logger.Fatal(err)
}
}