From 1b59b53b7dc4768fc22eb42dda36f3f1a4cfdd85 Mon Sep 17 00:00:00 2001 From: Mamoon Raja Date: Thu, 7 May 2020 16:47:41 -0400 Subject: [PATCH] fix: rename api path --- app.js | 4 ++-- views/demo.jsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 07cffee..7218766 100755 --- a/app.js +++ b/app.js @@ -41,7 +41,7 @@ app.get('/', (req, res) => { /** * Pipe the synthesize method */ -app.get('/api/v1/synthesize', async (req, res, next) => { +app.get('/api/v2/synthesize', async (req, res, next) => { try { const { result } = await textToSpeech.synthesize(req.query); const transcript = result; @@ -58,7 +58,7 @@ app.get('/api/v1/synthesize', async (req, res, next) => { }); // Return the list of voices -app.get('/api/v1/voices', async (req, res, next) => { +app.get('/api/v2/voices', async (req, res, next) => { try { const { result } = textToSpeech.listVoices(); res.json(result); diff --git a/views/demo.jsx b/views/demo.jsx index c4894fb..099941b 100755 --- a/views/demo.jsx +++ b/views/demo.jsx @@ -114,7 +114,7 @@ export default class Demo extends Component { onDownload(event) { event.target.blur(); const params = this.setupParamsFromState(true); - window.location.href = `/api/v1/synthesize?${params.toString()}`; + window.location.href = `/api/v2/synthesize?${params.toString()}`; } onSpeak(event) { @@ -123,7 +123,7 @@ export default class Demo extends Component { const audio = this.audioElementRef.current; audio.setAttribute('type', 'audio/ogg;codecs=opus'); - audio.setAttribute('src', `/api/v1/synthesize?${params.toString()}`); + audio.setAttribute('src', `/api/v2/synthesize?${params.toString()}`); this.setState({ loading: true, hasAudio: false }); }