-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
joerg
committed
May 25, 2021
1 parent
c9f79d3
commit dba0798
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import cherrypy, json, sys | ||
|
||
from topic_assistant import TopicAssistant | ||
|
||
a = None | ||
|
||
class WebService(object): | ||
|
||
@cherrypy.expose | ||
@cherrypy.tools.json_out() | ||
@cherrypy.tools.json_in() | ||
def topics(self): | ||
data = cherrypy.request.json | ||
print (data) | ||
output = a.go(data["text"]) | ||
return output | ||
|
||
|
||
if __name__ == '__main__': | ||
|
||
a = TopicAssistant() | ||
|
||
config = {'server.socket_host': '0.0.0.0'} | ||
cherrypy.config.update(config) | ||
cherrypy.quickstart(WebService()) |