我的服务器上运行了graphql
。我有一个像这样的上传路线:
server.route({
config: {
cors: {
origin: ['*'],
credentials: true
},
payload: {
output: 'stream',
parse: true,
maxBytes: 50869457,
allow: 'multipart/form-data'
},
},
method: ['POST', 'PUT'],
path: '/uploadAvatar',
handler: (request, reply) => {
const data = request.payload;
data.identity = options.safeGuard.authenticate(request);
// REQUEST TO THE SAME SERVER THIS IS RUNNING ON
}
});
如果有意义,我想向我所在的同一服务器发送请求。怎么做?
顺便说一下,如果localhost:3004/graphql
正在localhost:3004
上运行,我想拨打80
,但在生产时,它会在端口buttonClicked = pyqtSignal([int],[str])
上运行。