mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-21 23:15:06 +00:00
One
This commit is contained in:
25
blog/posts/main.go
Normal file
25
blog/posts/main.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/micro/micro/v3/service"
|
||||
"github.com/micro/micro/v3/service/logger"
|
||||
"github.com/micro/services/blog/posts/handler"
|
||||
tags "github.com/micro/services/blog/tags/proto"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create the service
|
||||
srv := service.New(
|
||||
service.Name("posts"),
|
||||
)
|
||||
|
||||
// Register Handler
|
||||
srv.Handle(&handler.Posts{
|
||||
Tags: tags.NewTagsService("tags", srv.Client()),
|
||||
})
|
||||
|
||||
// Run service
|
||||
if err := srv.Run(); err != nil {
|
||||
logger.Fatal(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user