7

我已经开始在 Ubuntu 上使用 Falcon 制作 API,我一直在使用 gunicorn 对其进行测试,但我也想尝试在 Windows 上开发它。

正如我们所知,gunicorn 还不能在 Windows 上运行,所以我将不得不使用另一台可以运行 wsgi 的服务器。经过一些研究,我尝试使用女服务员,但事情并没有像我想象的那样工作。

问题是,我不知道我做错了什么。

import srv3
from waitress import serve

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

这是名为 srv3 的应用程序文件

import falcon

api = application = falcon.API()

运行时出现此错误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)

有人可以给我看一个关于如何使用女服务员测试我的猎鹰应用程序的快速示例吗?

4

1 回答 1

7

如果你做from srv3 import api它似乎工作。所以我认为它应该是这样的:

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)
于 2016-04-05T14:38:17.133 回答