HDFGroup / h5serv

Reference service implementation of the HDF5 REST API
Other
168 stars 35 forks source link

The configuration of the StaticFileHandler isn't actually being used... #65

Closed manor closed 9 years ago

manor commented 9 years ago

The line of code that sets up the static path doesn't seem to be used:

https://github.com/HDFGroup/h5serv/blob/master/server/app.py#L3212

url(r"/static/(.*)", tornado.web.StaticFileHandler, {'path', '../static/'}),

If it is commented out nothing is affected. Conversely, if you try and change the path, as follows:

url(r"/demo/(.*)", tornado.web.StaticFileHandler, {'path', '../static/'}),

and then browse to a "static" url, you get a long series of errors starting with:

ERROR:tornado.application:Uncaught exception
Traceback (most recent call last):
  File ".....path_to_my_env...../python2.7/site-packages/tornado/http1connection.py", line 238, in _read_message
    delegate.finish()
  File ".....path_to_my_env...../python2.7/site-packages/tornado/httpserver.py", line 290, in finish
    self.delegate.finish()
  File ".....path_to_my_env...../python2.7/site-packages/tornado/web.py", line 1984, in finish
    self.execute()
  File ".....path_to_my_env...../python2.7/site-packages/tornado/web.py", line 2004, in execute
    **self.handler_kwargs)
TypeError: type object argument after ** must be a mapping, not set

I ended up changing the static path url by using a configuration setting:

seetings = {
  ...,
  "static_url_prefix": "/demo/",
  ...,

but it was a lucky break that I had that option...

jreadey commented 9 years ago

@manor - it happened I was just looking into this when I got your issue. I'll push out a fix today or tomorrow.

BTW - can you send me your email address to jreadey AT hdfgroup.org. Thanks.

jreadey commented 9 years ago

This is fixed in the commit: https://github.com/HDFGroup/h5serv/commit/09b28b6b6415ed1dc7f20b6a8cb499a4dad9f569.

Let me know if this works for you.

jreadey commented 9 years ago

Closing this.