Golang embed with http and middleware

124 views
Skip to first unread message

Daryl Williams

unread,
Nov 19, 2023, 6:15:29 PM11/19/23
to golang-nuts
I am trying to find out if the http server can work with the embed filesystem and also use middleware? And if so are there any articles describing how to do this?

Asks in advance,

Daryl

Tamás Gulácsi

unread,
Nov 20, 2023, 12:28:44 AM11/20/23
to golang-nuts
You can convert a io/fs.FS to a http FS with http.FS.

Tamás Gulácsi

unread,
Nov 20, 2023, 12:31:29 AM11/20/23
to golang-nuts
https://blog.carlmjohnson.net/post/2021/how-to-use-go-embed/ is a more comprehensive article on using embed.

Daryl Williams

unread,
Nov 20, 2023, 9:33:57 AM11/20/23
to Tamás Gulácsi, golang-nuts
Tamás, Thank you for your reply, I appreciate it. My confusion is more about how to use the embedded endpoints in a middleware chain. Do you know of any examples that do that? Thanks again for your response.

Daryl

On Nov 19, 2023, at 21:32, Tamás Gulácsi <tgula...@gmail.com> wrote:


You don't often get email from tgula...@gmail.com. Learn why this is important
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/9hZvvdhWlC4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e69a0ef1-960a-480d-b1a2-a3f8765ba741n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages