express 接口转发拦截不到直接报404什么问题?

 axios.get(`http://localhost:3000/api/annotationDetail`).then( res => {
                    console.log('0000000',res);
});
router.get('/api/annotationDetail'),(req,res)=>{
    const annotationID=req.param.annotationId;
    console.log('11111111111111');
    MongoClient.connect(mongoURL, function(err, db) {
        if (err) throw err;
        const dbo = db.db("path-cloud");
        dbo.collection('AnnotationFileGroups').findOne({_id: groupId}, (e, result) => {
            if(e) throw e;
            else {
                res.json({
                    code: 200,
                    data: '111',
                });
            }

        })
    });
 
}
阅读 1.4k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题