Skip to content

Commit

Permalink
Add /version to HTTP API
Browse files Browse the repository at this point in the history
  • Loading branch information
synesthesiam committed Oct 21, 2021
1 parent 9cbc0df commit 4ace91e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

_DIR = Path(__file__).parent
_VOICES_DIR = _DIR / "voices"
_VERSION = (_DIR / "VERSION").read_text().strip()

_LOGGER = logging.getLogger("opentts")
_LOOP = asyncio.get_event_loop()
Expand Down Expand Up @@ -805,6 +806,12 @@ async def api_voices():
return "\n".join(voices)


@app.route("/version", methods=["GET"])
async def api_version():
"""MaryTTS-compatible /version endpoint"""
return _VERSION


# -----------------------------------------------------------------------------


Expand Down
2 changes: 1 addition & 1 deletion tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import json
import logging
import platform
import re
import shlex
import shutil
import re
import tempfile
import typing
from abc import ABCMeta
Expand Down

0 comments on commit 4ace91e

Please sign in to comment.