ticker.py 703 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python3
  2. #
  3. # MMGen Node Tools, terminal-based programs for Bitcoin and forkcoin nodes
  4. # Copyright (C)2013-2025 The MMGen Project <mmgen@tuta.io>
  5. # Licensed under the GNU General Public License, Version 3:
  6. # https://www.gnu.org/licenses
  7. # Public project repositories:
  8. # https://github.com/mmgen/mmgen-node-tools
  9. # https://gitlab.com/mmgen/mmgen-node-tools
  10. """
  11. test.cmdtest_d.httpd.ticker: Ticker WSGI http server
  12. """
  13. from . import HTTPD
  14. class TickerServer(HTTPD):
  15. name = 'ticker server'
  16. port = 19900
  17. content_type = 'application/json'
  18. def make_response_body(self, method, environ):
  19. with open('test/ref/ticker/ticker.json') as fh:
  20. text = fh.read()
  21. return text.encode()