A
A
Adatan2020-02-08 19:35:17
go
Adatan, 2020-02-08 19:35:17

How to submit html+css page using gin package?

Oe5bi1S.png

router.NoRoute(noRoute)

func noRoute(c *gin.Context) {
  c.HTML(http.StatusNotFound, "404.html", nil)
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2020-02-08
@dimonchik2013

genie has a lot of examples,
look at github, there is JSON and there is HTML
there are a couple of lessons in Russian, there seems to be JSON

V
Vadim Rublev, 2020-02-12
@Vadim Rublev

As far as I understand, it is normal to return a static page (HTML, possibly other similar formats), with attached files, only the http.FileServer () function can.
I myself struggled with a similar problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question