0
tutorial 다음에 hapi.js 서버에 이미지 파일을 업로드하려고합니다. 나는이 오류와 함께 명중 오전 : 여기 dropzone.js 및 hapi.js를 사용하여 이미지를 업로드하는 방법
내 클라이언트 설치입니다 (이것은 로컬 호스트에서 실행중인 react.js 웹 클라이언트입니다 : 3000)CORS error: Some headers are not allowed
$('#upload')['dropzone']({
url: 'http://localhost:8000/api/sector/upload',
method: 'POST',
headers:{
'Cache-Control': null, //required for cors
'X-Requested-With': null, //required for cors,
'Access-Control-Allow-Origin': '*'
}
})
을 그리고 여기에 서버 내 다른 루트 측면 (로컬 호스트에서 실행 : 8000) :
method: 'POST',
path: '/api/sector/upload',
config:{
cors: true,
payload:{
output: 'stream',
parse: true,
allow: 'multipart/form-data',
maxBytes: 268435456
}
},
handler: function(request, reply) {
....
}
이 시나리오에서 어떻게 cors를 활성화 할 수 있습니까? 내 자신의 질문에 대답