WaaS.py 674 B

1234567891011121314151617181920
  1. import falcon
  2. import random
  3. import AdjectiveService
  4. import NounService
  5. app = api = falcon.API()
  6. aBasicResponder = AdjectiveService.AdjectiveGetter()
  7. aJsonResponder = AdjectiveService.AdjectiveGetterJSON()
  8. aXmlResponder = AdjectiveService.AdjectiveGetterXML()
  9. nBasicResponder = NounService.NounGetter()
  10. nJsonResponder = NounService.NounGetterJSON()
  11. nXmlResponder = NounService.NounGetterXML()
  12. api.add_route('/adjective/basic', aBasicResponder)
  13. api.add_route('/adjective/json', aJsonResponder)
  14. api.add_route('/adjective/xml', aXmlResponder)
  15. api.add_route('/noun/basic', nBasicResponder)
  16. api.add_route('/noun/json', nJsonResponder)
  17. api.add_route('/noun/xml', nXmlResponder)