const express = require('express');
const graphqlHTTP = require('express-graphql');
const schema = require('./schema/schema');
const app = express();
app.use('/graphql', graphqlHTTP({
schema,
graphiql: true,
}));
app.listen(5000, () => {
console.log('now listening for requests on port 5000')
})
GET http : // localhost : 5000 / 404 (찾을 수 없음)
localhost / : 1 ' http : // localhost : 5000 / favicon.ico ' 이미지 가 다음 콘텐츠 보안 정책 지시문 "default-src 'none'"을 위반하여 로드를 거부 했습니다. 'img-src'는 명시 적으로 설정되지 않았으므로 'default-src'가 폴백으로 사용됩니다.
"내 노드 앱에서 콘텐츠 보안 정책 오류가 발생합니다. 간단한 노드 서버 앱만 실행하고 있습니다. 오류 메시지 요청에 따라 루트 폴더에 favicon.ico 이미지를 추가했지만 실행되지 않습니다. 떨어져.
익스프레스 서버는 소스 디렉토리의 파일을 자동으로 제공하지 않습니다. 요청이 /favicon.ico
파일을 제공하도록하려면 서버에 적절한 로직을 추가해야합니다.
const path = require('path');
app.get('/favicon.ico', (req, res) => {
// Use actual relative path to your .ico file here
res.sendFile(path.resolve(__dirname, '../favicon.ico'));
});
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다