Skip to content

Commit

Permalink
Create webservice.py
Browse files Browse the repository at this point in the history
  • Loading branch information
joerg committed May 25, 2021
1 parent c9f79d3 commit dba0798
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/webservice.py
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())

0 comments on commit dba0798

Please sign in to comment.