-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
throwing this error #7
Comments
Error: Route.get() requires a callback function but got a [object Undefined] I got the same error (although i can invoke the index.htm in HTML subfolder) then in ........................................................... exports.token = function(req, res) { } so would this function(req, res) undefined?? Finally I checked out (as shown in error messages above), ZeroToCognitive/Chapter03/controller/restapi/router.js:7:8) router.get('/api/speech-to-text/token*',speech_to_text.stt_token); speech_to_text.stt_token should just be: speech_to_text.token I get to spend extra 1 day in learning node.js and follow the codes! |
Following the speech_to_text_complete.js in the answer folder, indeed it uses: exports.stt_token = function(req, res) {..................... so follow the speech_to_text_complete.js should also be fine as most of the rest of codes use "stt_token" |
/home/shiv/watsonworkspace/ZeroToCognitive/Chapter03/node_modules/express/lib/router/route.js:202
throw new Error(msg);
^
Error: Route.get() requires a callback function but got a [object Undefined]
at Route.(anonymous function) [as get] (/home/shiv/watsonworkspace/ZeroToCognitive/Chapter03/node_modules/express/lib/router/route.js:202:15)
at Function.proto.(anonymous function) [as get] (/home/shiv/watsonworkspace/ZeroToCognitive/Chapter03/node_modules/express/lib/router/index.js:510:19)
at Object. (/home/shiv/watsonworkspace/ZeroToCognitive/Chapter03/controller/restapi/router.js:7:8)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
The text was updated successfully, but these errors were encountered: