Skip to content

Instantly share code, notes, and snippets.

@mantzas
Created December 17, 2015 20:59
Show Gist options
  • Save mantzas/e074420afe0dd5ed3d71 to your computer and use it in GitHub Desktop.
Save mantzas/e074420afe0dd5ed3d71 to your computer and use it in GitHub Desktop.
package main
import (
common_http "bitusion.com/TradingSimulator/common/net/http"
"bitusion.com/TradingSimulator/services/order_command_service/handlers"
log "github.com/Sirupsen/logrus"
"net/http"
_ "net/http/pprof"
"os"
)
func init() {
// Log as JSON instead of the default ASCII formatter.
log.SetFormatter(&log.TextFormatter{})
// Output to stderr instead of stdout, could also be a file.
log.SetOutput(os.Stderr)
// Only log the warning severity or above.
log.SetLevel(log.DebugLevel)
}
func main() {
http.Handle("/", common_http.DefaultPostMiddleware(handlers.CreateOrderHandler()))
log.Fatal(http.ListenAndServe(":8080", nil))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment