FAQ
I'm trying to set up a basic web app and I'm struggling with some basic
routing rules. I want that the root ("/") is handled by one handler and a
directory like /static/ by the FileServer. However, when using HandleFunc
with "/" as the pattern every request will be handled by only this handler,
the FileServer will never be called.

Thanks a lot.

--

Search Discussions

  • Dustin Sallings at Nov 23, 2012 at 8:34 pm

    Nick writes:

    I'm trying to set up a basic web app and I'm struggling with some
    basic routing rules. I want that the root ("/") is handled by one
    handler and a directory like /static/ by the FileServer. However, when
    using HandleFunc with "/" as the pattern every request will be handled
    by only this handler, the FileServer will never be called.
    Are you sure? Can you show a small sample that doesn't work the way
    you think it should.

    --
    dustin

    --
  • Nick at Nov 23, 2012 at 9:47 pm
    Nevermind. I just found out I forgot the trailing slash for the FileServer
    directory...


    Am Freitag, 23. November 2012 21:34:28 UTC+1 schrieb Dustin:
    Nick <heb...@gmail.com <javascript:>> writes:
    I'm trying to set up a basic web app and I'm struggling with some
    basic routing rules. I want that the root ("/") is handled by one
    handler and a directory like /static/ by the FileServer. However, when
    using HandleFunc with "/" as the pattern every request will be handled
    by only this handler, the FileServer will never be called.
    Are you sure? Can you show a small sample that doesn't work the way
    you think it should.

    --
    dustin
    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 23, '12 at 8:21p
activeNov 23, '12 at 9:47p
posts3
users2
websitegolang.org

2 users in discussion

Nick: 2 posts Dustin Sallings: 1 post

People

Translate

site design / logo © 2021 Grokbase