Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Falcon through Waitress on Windows OS

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?

like image 222
Nick Avatar asked Mar 01 '16 16:03

Nick


People also ask

What is Falcon API?

Falcon is a blazing fast, minimalist Python web API framework for building robust app backends and microservices. The framework works great with both asyncio (ASGI) and gevent/meinheld (WSGI).

What is Falcon Python?

Falcon is a reliable, high-performance Python web framework for building large-scale app backends and microservices. It encourages the REST architectural style, and tries to do as little as possible while remaining highly effective.


1 Answers

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)
like image 181
waalp Avatar answered Sep 22 '22 19:09

waalp