0
저는 nodejs를 처음 접했고 route를 만드는 데 restify를 사용하고 있습니다. 경로 중 하나는 다른 API를 호출하고 응답을 보내려고합니다. 가 GET이/관리자 경로에서 수행되는 경우nodejs가 API를 호출하여 응답에서 응답을 반환합니다.
server.get({path:'/admin'},
function respond(req, res, next){
var options = { method: 'GET',
url: argv.OKTA + "/api/v1/apps/" + argv.OKTA_APP_ID,
headers:
{ authorization: argv.OKTA_API,
'content-type': 'application/json',
accept: 'application/json' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
res.send(200, body);
return next();
});
});
그래서, 그것은 가서 다른 URL을 호출하고 다시 반응을 얻고 사용해야하는
지금 다시/관리에 대한 응답으로 , 내가 대신이 얻을 : 당신은 응답을 보내는 때문에
{"code":"ResourceNotFound","message":"/admin does not exist"}
여전히 작동하지 않습니다. – roymustang86