0
let post =
{
method: 'POST',
path: '/posts/new/{postType}',
handler: (request, reply) =>{
//when params is text
if (request.params.postType == "text")
{
return reply("successfully uploaded text post");
}
//when params is image
else (request.params.postType == "image")
{
//call proxy uri to save the image
/*proxy:
{
uri: proxyUri + '/post/image', //call proxy uri to save the image
passThrough: true,
acceptEncoding: false,
}*/
}
}
我如何有条件地调用基于路由参数的代理服务器,所以我使用一个休息api文本,图像,vides等?如何根据路由参数有条件地调用代理服务器?