I am working on an APi using express in node.js.
Controler:
/**
* @module QuestionController
*/
//1st Action
exports.videoUploaded = function(req,res)
{
// myCode();
}
//2nd Action
exports.transcribe = function(req, res)
{
var id = req.params.question_id;
// myCode();
}
Route:
var questionController = require('./../controllers/question');
var apiRouter = express.Router();
apiRouter.route('/questions/:question_id/video_uploaded')
.post(Auth.roleAtLeastPatient,questionController.videoUploaded);
apiRouter.route('/questions/:question_id/transcribe')
.post(Auth.roleAtLeastPatient,questionController.transcribe);
My server file:
var app = require('./srv/express-app');
var webserver = http.createServer(app);
Everything works fine, I can call these, endpoints from the browser and Postman. But, how can I call, transcribe
action from inside videoUploaded
action, while sending the req
params too.