news_server/run.py
2019-12-29 21:33:37 +08:00

24 lines
388 B
Python

# -*- coding: UTF-8 -*-
import web
from mod.news import News
urls = (
'/news','api',
)
# render = web.template.render('templates')
app = web.application(urls, globals())
#api的方法
class api:
def GET(self):
news = News()
return news.content()
def POST(self):
news = News()
return news.content()
if __name__ == '__main__':
app.run()