Skip to content

Commit bc0108c

Browse files
author
Dean Karn
authored
Merge pull request #2 from tectiv3/master
Readme typos and static files example fixes
2 parents a69d5d4 + 145a9ee commit bc0108c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ URL Params
7272
p := p.New()
7373

7474
// the matching param will be stored in the context's params with name "id"
75-
l.Get("/user/:id", UserHandler)
75+
p.Get("/user/:id", UserHandler)
7676

7777
// extract params like so
78-
rv := pure.ReqestVars(r) // done this way so only have to extract from context once, read above
78+
rv := pure.RequestVars(r) // done this way so only have to extract from context once, read above
7979
rv.URLParam(paramname)
8080

8181
// serve css, js etc.. pure.RequestVars(r).URLParam(pure.WildcardParam) will return the remaining path if
8282
// you need to use it in a custom handler...
83-
l.Get("/static/*", http.FileServer(http.Dir("static/")))
83+
p.Get("/static/*", http.FileServer(http.Dir("static/").ServeHTTP))
8484

8585
...
8686
```
@@ -131,17 +131,17 @@ Misc
131131
```go
132132

133133
// set custom 404 ( not Found ) handler
134-
l.Register404(404Handler, middleware_like_logging)
134+
p.Register404(404Handler, middleware_like_logging)
135135

136136
// Redirect to or from ending slash if route not found, default is true
137-
l.SetRedirectTrailingSlash(true)
137+
p.SetRedirectTrailingSlash(true)
138138

139139
// Handle 405 ( Method Not allowed ), default is false
140-
l.RegisterMethodNotAllowed(middleware)
140+
p.RegisterMethodNotAllowed(middleware)
141141

142142
// automatically handle OPTION requests; manually configured
143143
// OPTION handlers take precedence. default false
144-
l.RegisterAutomaticOPTIONS(middleware)
144+
p.RegisterAutomaticOPTIONS(middleware)
145145

146146
```
147147

0 commit comments

Comments
 (0)