Skip to content

Instantly share code, notes, and snippets.

@asim
Created November 16, 2020 07:40
Show Gist options
  • Save asim/99d3bea6fdd234b373473309cab055a1 to your computer and use it in GitHub Desktop.
Save asim/99d3bea6fdd234b373473309cab055a1 to your computer and use it in GitHub Desktop.
package main
import (
"posts/handler"
"github.com/micro/micro/v3/service"
"github.com/micro/micro/v3/service/logger"
)
func main() {
// Create the service
srv := service.New(
service.Name("posts"),
)
// Register Handler
srv.Handle(handler.NewPosts())
// Run service
if err := srv.Run(); err != nil {
logger.Fatal(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment