DronRathore/goexpress

Rendering HTML Views

Closed this issue · 4 comments

s2t2 commented

Hi, I was wondering if it is possible to use this library to render an HTML view file at a given path. And if so, how?

s2t2 commented

I guess the desired usage would be something like:

app.Get("/hello", func(req *request.Request, res *response.Response, next func()){
	   res.Render("./views/hello.html", false)
  })

Hey @s2t2, apologies for delayed response, I think i didn't quite get you, do you want to pass dynamic options to the html or you just want to send the HTML response?
You can use res.Send to send an HTML file by passing a file path.

But would be a good feature though to support this, I may work on this one on a weekend, I am thinking of letting render function take options too so that you can render dynamic content.