February 2018
Intermediate to advanced
246 pages
6h 3m
English
The source file is responsible for initializing routes, starting the index system and starting the web server:
package main
import (
"net/http"
"github.com/last-ent/distributed-go/chapter7/goophr/librarian/api"
"github.com/last-ent/distributed-go/chapter7/goophr/librarian/common"
)
func main() {
common.Log("Adding API handlers...")
http.HandleFunc("/api/index", api.IndexHandler)
http.HandleFunc("/api/query", api.QueryHandler)
common.Log("Starting index...")
api.StartIndexSystem()
common.Log("Starting Goophr Librarian server on port :9090...")
http.ListenAndServe(":9090", nil)
}
Read now
Unlock full access