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

Add some more functions? #38

Open
xpbliss opened this issue Feb 5, 2016 · 1 comment
Open

Add some more functions? #38

xpbliss opened this issue Feb 5, 2016 · 1 comment

Comments

@xpbliss
Copy link

xpbliss commented Feb 5, 2016

1.When visit the static page ,such as http://localhost:8080/static/index.html,It still execute the Controller's All Initially() and Before() function? if visit the static page ,it will execute these function many time,because the index.htm include some css and js and jpg?
Maybe another usage is that we can intercept the static file. Maybe should make a switch for it?

the route for static is:
r.Get("/static/*filepath", http.StripPrefix("/static/", http.FileServer(http.Dir("./static")), ).ServeHTTP),

2.There are still not RenderXML and RenderFile methods.

3.Have a flash function like revel's flash function? and the compressionTypes,cache.....?

4.https? http2?

@ghost
Copy link

ghost commented Feb 5, 2016

  1. No. http.StripPrefix("/static/", http.FileServer(http.Dir("./static")) is not an action but a set of functions from standard library. That's why neither Initially nor Before will be started when serving a static page or some other static assets.
  2. I have added xml. Now need to create a files controller with the analogues of Revel's RenderFile and RenderBinary.
    Plus, a controller with Redirect, RenderNotFound, RenderError, RenderToDo, RenderForbidden would be helpful.
    At some point I'll implement all of this. BTW, PRs to colegion/contrib repo are welcome.
  3. There is no flash controller. I'll implement it today or tomorrow.
    Neither compression nor cache controllers have been added yet, too.
  4. HTTPS is supported. Update server/server.go:
import (
    ...
+   "crypto/tls"
)
...
func Start(configFiles ...string) error {
    ...
    s := &http.Server{
        Addr:    *addr,
        Handler: h,
+       TLSConfig: &tls.Config{
+           ...
+       }
    }
    ...
}

As for the HTTP2, it's already there is you're using Go1.6+.

@ghost ghost added this to the v0.0.2 milestone Feb 5, 2016
@ghost ghost self-assigned this Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant