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

15 lines
821 B
JavaScript

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')
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)
router.route('/voice-config').get(getVoiceConfig)
module.exports = router