4 ms·
Build a Christmas List with Martini
- cvburgess 13y agoDoes anyone have any comparisons of Martini and Flask/Bottle or Sinatra? It would be interesting to compare performance, library support, and syntax of these (seemingly similar) micro-frameworks.
- neya 13y agoFrom what I've seen, Go lang when used with a Framework, returns somewhat comparable performance to Node.js This should give you a rough idea: (Revel is a Go based framework here) http://www.techempower.com/benchmarks/#section=data-r5&hw=i7&test=db&l=o00&f=21t94-8vn08x-0 http://www.techempower.com/benchmarks/#section=data-r5&hw=i7...
- codegangsta 13y agoAuthor here. One question I often get about Martini is how to hook it up to a database. I hope this post helps explain the Martini workflow a bit more!
- toni 13y agoIn the event you feel like answering, most martini examples I have seen instruct us to execute `go run main.go`. Is that the "right" way to run martini? Shouldn't I compile my martini app first?
- codegangsta 13y ago`go run` compiles your app already. In the case that you have multiple files in your package you will need to run `go build`
- BarkMore 13y agoThis is not the recommended way to run Go applications, including those using Martini. Use "go build" or "go install" to build a binary and then execute the binary.
- pjschlic 13y agoI'm not familiar with Martini, but it looks like DB() is mapping a connection to the "advent" db based on the idea I'm asking for a mgo.Database. It makes me wonder how I might have multiple databases used by my server - maybe if advent lists and user logins were in different databases or something?
- fleitz 13y agoChristmas lists should be written using PenAndPaper. You can create a wishlist in about a minute using absolutely zero lines of code. Here's a great tutorial on how you can get started with PenAndPaper. http://studenthacks.org/wp-content/uploads/2007/11/thesis-paper.jpg http://studenthacks.org/wp-content/uploads/2007/11/thesis-pa...