mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-12 22:07:47 +02:00
Cleanup and move template
This commit is contained in:
30
examples/server/main.go
Normal file
30
examples/server/main.go
Normal file
@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
log "github.com/golang/glog"
|
||||
"github.com/myodc/go-micro/cmd"
|
||||
"github.com/myodc/go-micro/examples/server/handler"
|
||||
"github.com/myodc/go-micro/server"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// optionally setup command line usage
|
||||
cmd.Init()
|
||||
|
||||
server.Name = "go.micro.srv.example"
|
||||
|
||||
// Initialise Server
|
||||
server.Init()
|
||||
|
||||
// Register Handlers
|
||||
server.Register(
|
||||
server.NewReceiver(
|
||||
new(handler.Example),
|
||||
),
|
||||
)
|
||||
|
||||
// Run server
|
||||
if err := server.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user