FAQ
Hi,
Instead of statically specifying the route pattern and the handlers, can I just specify that all requests go to a common handler func.
In this common handler func at the run time I can dynamically decide which handler to execute.
Please provide a small code snippet.
Will be helpful.

Thanks in advance,
Subhajit

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Jesse McNelis at Feb 25, 2015 at 4:28 am

    On Wed, Feb 25, 2015 at 1:05 PM, wrote:
    Hi,
    Instead of statically specifying the route pattern and the handlers, can I just specify that all requests go to a common handler func.
    In this common handler func at the run time I can dynamically decide which handler to execute.
    Please provide a small code snippet.
    Will be helpful.
    If you add a handler for "/" then all requests will go to it.
    eg.

    http.Handle("/", yourHandler) // all requests will go to yourHandler

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 25, '15 at 2:08a
activeFeb 25, '15 at 4:28a
posts2
users2
websitegolang.org

2 users in discussion

Subahjit: 1 post Jesse McNelis: 1 post

People

Translate

site design / logo © 2022 Grokbase