Falcon through Waitress on Windows OS
Asked Answered
W

1

7

i've started making an API using Falcon on Ubuntu and I've been using gunicorn to test it but I also want to try developing it on Windows too.

As we know gunicorn doesn't work on Windows yet so I will have to use another server that can run wsgi. After some research I tried using waitress but things don't work the way I thought it would.

Thing is, i don't know what I am doing wrong.

import srv3
from waitress import serve

serve(srv3, host='127.0.0.1', port=5555) # it is the same if i use serve(srv3)

This is the app file called srv3

import falcon

api = application = falcon.API()

and i get this error when running http localhost:5555

HTTP/1.1 500 Internal Server Error
Content-Length: 110
Content-Type: text/plain
Date: Tue, 01 Mar 2016 16:34:45 GMT
Server: waitress

Internal Server Error

The server encountered an unexpected internal server error

(generated by waitress)

could someone show me a quick example on how to use waitress to test out my falcon app?

Whatever answered 1/3, 2016 at 16:23 Comment(1)
Thanks for getting it working on windowsDehart
C
7

If you do a from srv3 import api it seems to work. So I think it should be something like this:

from srv3 import api
from waitress import serve

serve(api, host='127.0.0.1', port=5555) # it is the same if i use serve(srv3)
Cardamom answered 5/4, 2016 at 14:38 Comment(1)
Yup, I am officially an idiot, this worked and it's fairly obvious since I wasn't passing the app to waitress, i was passing the file.Whatever

© 2022 - 2024 — McMap. All rights reserved.