mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-29 00:32:14 +00:00
24 lines
508 B
Go
24 lines
508 B
Go
|
package rpc
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"net/http"
|
||
|
|
||
|
. "github.com/tendermint/tendermint/config"
|
||
|
)
|
||
|
|
||
|
func StartHTTPServer() {
|
||
|
|
||
|
//http.HandleFunc("/path", handler)
|
||
|
//http.HandleFunc("/path", handler)
|
||
|
|
||
|
// Serve HTTP on localhost only.
|
||
|
// Let something like Nginx handle HTTPS connections.
|
||
|
address := fmt.Sprintf("127.0.0.1:%v", Config.RPC.HTTPPort)
|
||
|
log.Info("Starting RPC HTTP server on http://%s", address)
|
||
|
|
||
|
go func() {
|
||
|
log.Fatal(http.ListenAndServe(address, RecoverAndLogHandler(http.DefaultServeMux)))
|
||
|
}()
|
||
|
}
|