Building Web Applications in Go

1,956 views
1,853 views

Published on

A quick overview of building simple web applications in Go.

Published in: Technology, Design
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,956
On SlideShare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
15
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Building Web Applications in Go

  1. 1. Building Web Applications in Go @micrypt
  2. 2. Google Go http://golang.org/
  3. 3. A simple app (Demo)
  4. 4. Web.go (http://github.com/hoisie/web.go) Go-twitter (http://jb55.github.com/go-twitter)
  5. 5. package main
  6. 6. import ( "twitter" "web" // "mustache" )
  7. 7. // Struct to store a single tweet type tweet_item struct { user string tweet string } // URL Parameters type myparams struct { name string hashtag string }
  8. 8. // Function to render index page func index() string { return … } // Function to render search results func find(ctx *web.Context) string { return … }
  9. 9. // Create URL routes and run server func main() { web.Get("/", index) web.Post("/find", find) web.Run("0.0.0.0:9999") }
  10. 10. Done! @micrypt http://godashboard.appspot.com/project

×