natural-language-api-google/routes/naturalLanguageRoute.js

15 lines
821 B
JavaScript
Raw Normal View History

2023-10-09 17:22:48 +00:00
const express = require('express')
const router = express.Router()
const { authorization, } = require('../middleware/authentication')
const { audioUpload } = require("../utils")
const { getSentiment, getAudioFromText, getTextFromAudio, getVoiceConfig, uploadAudioToTranscript, getJobStatus } = require('../controllers/naturalLanguageController')
2023-10-09 17:22:48 +00:00
router.route('/sentiment').post(authorization, getSentiment)
router.route('/text-to-speech').get(authorization, getAudioFromText)
router.route('/speech-to-text').post(audioUpload.single('audio'), authorization, getTextFromAudio)
router.route('/upload-audio-to-transcript').post(audioUpload.single('audio'), authorization, uploadAudioToTranscript)
router.route('/query-job-status').get(getJobStatus)
2023-10-09 17:22:48 +00:00
router.route('/voice-config').get(getVoiceConfig)
module.exports = router