错误:Route.get()需要回调函数
我越来越
错误:Route.get()需要回调函数,但得到[对象未定义]
这是我的路线文件:
var express = require("express");
var app = express();
var router = express.Router();
var ctrlLocations = require('../controllers/locations');
var ctrlReviews = require('../controllers/reviews');
/**Locations*/
/*router.get('/locations', ctrlLocations.locationsListByDistante);
*/
router.post('/locations', ctrlLocations.locationsCreate);
router.get('/locations/:locationid', ctrlLocations.locationsReadOne);
module.exports = router;
错误日志:
错误:Route.get()需要一个回调函数,但在Route上有一个[object Undefined](匿名函数)[as get](C: Users Pai Desktop mean node_modules express lib router route (匿名函数)[as get](C: Users Pai Desktop mean node_modules express lib router index.js:510:19)在Object中的函数.js:202: 。 在Module._compile(module.js:570:32)上的Object.Module._extensions..js(module.js(module.js:14:12))中创建一个文件夹(C: Users Pai Desktop mean app_api routes index.js: (module.js:446:12)在Function.Module._load(module.js:438:3)上的Module.load(module.js:487:32) .js:497:17)在对象的require(internal / module.js:20:19)。 (module.js:579:10)在Module._compile(module.js:570:32)上的位置(C: Users Pai Desktop mean app.js:22:17) )在Function.Module._load(module.js:438:3)处的try.ModuleLoad(module.js:446:12)处的Module.load(module.js:487:32)
链接地址: http://www.djcxy.com/p/33033.html上一篇: Error: Route.get() requires a callback function
下一篇: JavaScript heap out of memory error while creating build in angular 2