Skip to content

Instantly share code, notes, and snippets.

@LeKovr
Last active December 12, 2015 09:08
Show Gist options
  • Save LeKovr/74a8288a4cdcde0b1df3 to your computer and use it in GitHub Desktop.
Save LeKovr/74a8288a4cdcde0b1df3 to your computer and use it in GitHub Desktop.
Go lang: use Macaron, step 1
package main
// Code from http://go-macaron.com/docs/middlewares/templating
import (
"gopkg.in/macaron.v1"
"github.com/skratchdot/open-golang/open"
)
func main() {
m := macaron.Classic()
m.Use(macaron.Renderer())
m.Get("/", func(ctx *macaron.Context) {
ctx.Data["Name"] = "jeremy"
ctx.HTML(200, "hello") // 200 is the response code.
})
open.Run("http://localhost:4000/")
m.Run()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment