Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated readme and created example. #8

Merged
merged 1 commit into from Nov 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 24 additions & 14 deletions README.md
Expand Up @@ -6,20 +6,6 @@ __UNSTABLE VERSION 2.0__: The current stable version is here [forgery](https://g

Forgery is a minimal and flexible golang web application framework, providing a robust set of features for building single and multi-page, web applications.

package main

import(
"github.com/goforgery/forgery2"
)

func init() {
app := f.CreateApp()
app.Get("/", func(req *f.Request, res *f.Response, next func()) {
res.Send("Hello world.")
})
app.Listen(3000)
}

* Robust routing
* HTTP helpers (redirection, caching, etc)
* View system supporting 1 template engine (hopefully more will come)
Expand All @@ -28,6 +14,30 @@ Forgery is a minimal and flexible golang web application framework, providing a
* Environment based configuration
* High test coverage

## Install

go get github.com/goforgery/forgery2

## Use

Starts a web server.

```javascript
package main

import(
"github.com/goforgery/forgery2"
)

func main() {
app := f.CreateApp()
app.Get("/", func(req *f.Request, res *f.Response, next func()) {
res.Send("Hello world.")
})
app.Listen(3000)
}
```

## Testing

go test ./...
Expand Down
13 changes: 13 additions & 0 deletions examples/simple.go
@@ -0,0 +1,13 @@
package main

import(
"github.com/goforgery/forgery2"
)

func main() {
app := f.CreateApp()
app.Get("/", func(req *f.Request, res *f.Response, next func()) {
res.Send("Hello world.")
})
app.Listen(3000)
}