Defining routes

Now that we have the required dependencies, we will update the routes. To work with the Natural Language API, we are going to add only one route that will accept the text and respond back with the Natural Language response. Update server outescloud-ai-api.ts and add the upload-audio route as shown in the following code:

// SNIPP SNIPP
router.post('/upload-image/:threadId', Authenticate, Authorize('user'), upload.single('image-reply'), cloudAIAPI.uploadImage);
router.post('/upload-video/:threadId', Authenticate, Authorize('user'), upload.single('video-reply'), cloudAIAPI.uploadVideo);
router.post('/upload-audio/:threadId', Authenticate, Authorize('user'), upload.single('audio-reply'), cloudAIAPI.uploadAudio);
router.post('/post-message', Authenticate, Authorize('user'), cloudAIAPI.postMessage);
// SNIPP SNIPP
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.129.90