跳转到主要内容

Interest是一个基于aiohttp/asyncio的事件驱动Web框架。

项目描述

# Interest

[![Travis](https://img.shields.io/travis/inventive-ninja/interest.svg)](https://travis-ci.org/inventive-ninja/interest)
[![Coveralls](http://img.shields.io/coveralls/inventive-ninja/interest.svg?branch=master)](https://coveralls.io/r/inventive-ninja/interest?branch=master)

基于aiohttp/asyncio的事件驱动Web框架。

## 特性

- 基于 aiohttp/asyncio 的事件驱动
- 一致、模块化和灵活的流程模型,基于类
- 可配置和可插拔

## 示例

安装interest包

```
$ pip install interest
```

将以下代码保存为 `server.py`


```python
# server.py
from interest import Service, http

class Service(Service)

# 公共

@http.get('/')
def hello(self, request)
return http.Response(text='Hello World!')


# 永久监听
service = Service()
service.listen(host='127.0.0.1', port=9000, override=True, forever=True)
```

在终端中运行服务器,并使用另一个终端进行交互

```
$ python server.py
...
$ curl -X GET http://127.0.0.1:9000/; echo
Hello World!
...
```

## 更多内容

请访问Interest的开发者中心以获取文档、新闻和支持

[开发者中心](https://interest.readme.io/)

## 贡献

请阅读贡献指南

[如何贡献](CONTRIBUTING.md)

谢谢!

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码分发

interest-0.0.1.tar.gz (20.7 kB 查看哈希值)

上传时间 源代码

构建分发

interest-0.0.1-py3-none-any.whl (33.2 kB 查看哈希值)

上传时间 Python 3

AWSAWS云计算和安全赞助商DatadogDatadog监控FastlyFastlyCDNGoogleGoogle下载分析MicrosoftMicrosoftPSF赞助商PingdomPingdom监控SentrySentry错误日志StatusPageStatusPage状态页