Can't find the wsgi wrapper programatically #9
Comments
Sorry, I'm not sure I follow what exactly isn't working. I'm not familiar with serverless, but I was able to follow the It seems to work just fine with molten. |
@Bogdanp that’s great. I’ll dig and see where I went wrong on this. I’m loving the craftsmanship on molten. I’ll get this into production and have more feedback. |
There does appear to be a bug here, though it's not related to the App object. When I made my last comment, I had only tried it using the local server, but it looks like once you deploy the package to AWS, routing breaks down due to the way the request path is interpreted by Request objects (it shouldn't include the script name in the request path). That should be easy to fix and I'll try to do it tonight. |
Alright, that bug I mentioned is fixed in 0.4.2. |
Happy to help. Could you put the entire trace here the error is generic enough that no immediate solution comes to mind. |
Thank you @dgonzo ! sure Zappa tail Zappa Status Status for openapi-dev: Pip3 freeze argcomplete==1.9.3 Zappa Config (as txt) |
Checklist
What OS are you using?
macOS 10.13.6
What version of molten are you using?
molten==0.4.1
What did you do?
I'm using the serverless framework to deploy an API to AWS lambda. It has a function call -- serve -- that is expecting to find a wsgi app.
With flask this "just works" (i.e. default supported framework for most of these easy-of-use frameworks like zappa or serverless).
You can see that the
serve
function call isn't very complex other than some monkey patching.This works with flask. It also works with the hug but it's not strait forward. With that I have to point serverless explicitly at the wisgi "magic method":
__hug_wsgi__
.Digging through hug I see where the http.server is added into the app singleton.
What did you expect would happen?
Ideally, the molten app instance would caugh up wsgi as simply as flask but even if it were like hug that would work. I'm open to other options.
I was able to get werkzeug to serve molten like this:
What happened?
Right now I'm unable to find something suitable in molten to pass to pass into werkzeug so at present I can't host molten inside serverless.
The text was updated successfully, but these errors were encountered: