Last active
December 12, 2015 09:08
-
-
Save LeKovr/74a8288a4cdcde0b1df3 to your computer and use it in GitHub Desktop.
Go lang: use Macaron, step 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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