Skip to content

Commit 9216362

Browse files
committed
Update readme
1 parent b0acb23 commit 9216362

File tree

2 files changed

+17
-43
lines changed

2 files changed

+17
-43
lines changed

Readme.md

+16-42
Original file line numberDiff line numberDiff line change
@@ -2,79 +2,53 @@
22

33
web.go is the simplest way to write web applications in the Go programming language.
44

5+
See [www.getwebgo.com](http://www.getwebgo.com) for complete documentation.
6+
57
## Overview
68

79
web.go should be familiar to people who've developed websites with higher-level web frameworks like sinatra, pylons, or web.py. It is designed to be a lightweight web framework that doesn't impose any scaffolding on the user. Some features include:
810

9-
* routing to url handlers based on regular expressions
10-
* helper methods for rendering templates
11-
* web applications are compiled to native code, which means very fast page render times (order-of-magnitude improvement over python or ruby frameworks)
11+
* Routing to url handlers based on regular expressions
12+
* Support for user sessions
13+
* Web applications are compiled to native code. This means very fast execution and page render speed ( benchmarks coming soon :)
1214

1315
To use web.go, simply install it and import the "web" package. You then need to map url routes to function handlers using web.Get, web.Post, etc.. Finally, you need to call web.Run with the address of the host. (see the example below)
1416

1517
## Installation
1618

17-
1. Make sure you have the latest Go sources (hg sync in the go tree), and your environment is set up correctly: $GOROOT, $GOARCH, $GOBIN, etc.
18-
2. Checkout the code
19+
1. Make sure you have the a working Go environment. See the [install instructions](http://golang.org/doc/install.html)
20+
2. git clone git://github.com/hoisie/web.go.git
1921
3. cd web.go && make install
2022

2123
## Example
2224

2325
package main
2426

2527
import (
26-
"fmt"
2728
"web"
2829
)
2930

30-
func hello(val string) string {
31-
return fmt.Sprintf("hello %s", val)
32-
}
31+
func hello(val string) string { return "hello " + val }
3332

3433
func main() {
3534
web.Get("/(.*)", hello)
3635
web.Run("0.0.0.0:9999")
3736
}
3837

3938

40-
### Adding route handlers
41-
42-
We add a handler that matches the url path "/today". This will return the current url path.
43-
44-
package main
45-
46-
import (
47-
"fmt"
48-
"time"
49-
"web"
50-
)
51-
52-
func index() string {
53-
return "Welcome!"
54-
}
39+
To run the application, put the code in a file called hello.go and run:
5540

56-
func today() string {
57-
return fmt.Sprintf("The time is currently %s", time.LocalTime().Asctime())
58-
}
59-
60-
func main() {
61-
web.Get("/today", today)
62-
web.Get("/", index)
63-
web.Run("0.0.0.0:9999")
64-
}
65-
66-
Then stop the application and recompile it . You can point your browser to http://localhost:9999/today to see the new route.
41+
8g hello.go && 8l -o hello hello.8 && ./hello
6742

68-
## Roadmap
43+
You can point your browser to http://localhost:9999/world .
6944

70-
Future releases will support:
45+
## Documentation
7146

72-
* fastcgi and proxying support
73-
* an interface to write real-time applications (for long-polling)
74-
* a better template system
75-
* cookie-based sessions with storage
47+
More documentation, including a tutorial and API docs, is available on [web.go's home page][http://www.getwebgo.com]
7648

7749
## About
7850

79-
web.go was written by Michael Hoisie. Follow me on [Twitter](http://www.twitter.com/hoisie)!
51+
web.go was written by [Michael Hoisie](http://hoisie.com).
52+
53+
Follow me on [Twitter](http://www.twitter.com/hoisie)!
8054

examples/hello.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"web"
55
)
66

7-
func hello(val string) string { return "hello " + val }
7+
func hello(val string) string { return "hello " + val }
88

99
func main() {
1010
web.Get("/(.*)", hello)

0 commit comments

Comments
 (0)