Skip to content
This repository has been archived by the owner on Jan 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #135 from watson-developer-cloud/fix/change-api-name
Browse files Browse the repository at this point in the history
fix: rename api path
  • Loading branch information
mamoonraja authored May 7, 2020
2 parents b00ec0b + 1b59b53 commit c86c22f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions views/demo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 });
}
Expand Down

0 comments on commit c86c22f

Please sign in to comment.