Exemplo n.º 1
0
func main() {
	server := artichoke.New(nil,
		artichoke.BasicAuth(map[string]string{"jack": "johnson"}, false),
		artichoke.QueryParser(),
		artichoke.BodyParser(1024*10),
		logger,
		genRoutes(),
		artichoke.Static("./public"),
	)
	server.Run("localhost", 3345)
}
Exemplo n.º 2
0
func main() {
	var err error
	session, err = mgo.Mongo("localhost:27017")
	if err != nil {
		panic(err)
	}

	server := artichoke.New(nil, artichoke.QueryParser(), artichoke.BodyParser(1024), artichoke.Router(genRoutes()))
	server.Run(3345, "localhost")

	<-kill
	session.Close()
}