From 50a6fa060b02c3798ad957e897843fcbe105cabb Mon Sep 17 00:00:00 2001 From: Chaeyeon1 <66813821+Chaeyeon1@users.noreply.github.com> Date: Wed, 29 Nov 2023 00:12:43 +0900 Subject: [PATCH] =?UTF-8?q?config=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/next.config.js | 112 ++++++++++++----------- client/package.json | 1 + client/src/app/[blogName]/scrap/page.tsx | 3 +- 3 files changed, 60 insertions(+), 56 deletions(-) diff --git a/client/next.config.js b/client/next.config.js index b58bb7a6..d0e13172 100644 --- a/client/next.config.js +++ b/client/next.config.js @@ -12,47 +12,48 @@ const removeImports = require('next-remove-imports')(); // font-src 'self'; // frame-src giscus.app // `; -const securityHeaders = [ - // https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP - { - key: 'Content-Security-Policy', - value: 'upgrade-insecure-requests', - // value: ContentSecurityPolicy.replace(/\n/g, ''), - }, - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy - { - key: 'Referrer-Policy', - value: 'strict-origin-when-cross-origin', - }, - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options - { - key: 'X-Frame-Options', - value: 'DENY', - }, - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options - { - key: 'X-Content-Type-Options', - value: 'nosniff', - }, - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control - { - key: 'X-DNS-Prefetch-Control', - value: 'on', - }, - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security - { - key: 'Strict-Transport-Security', - value: 'max-age=31536000; includeSubDomains', - }, - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy - { - key: 'Permissions-Policy', - value: 'camera=(), microphone=(), geolocation=()', - }, -]; +// const securityHeaders = [ +// // https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP +// { +// key: 'Content-Security-Policy', +// value: 'upgrade-insecure-requests', +// // value: ContentSecurityPolicy.replace(/\n/g, ''), +// }, +// // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy +// { +// key: 'Referrer-Policy', +// value: 'strict-origin-when-cross-origin', +// }, +// // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options +// { +// key: 'X-Frame-Options', +// value: 'DENY', +// }, +// // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options +// { +// key: 'X-Content-Type-Options', +// value: 'nosniff', +// }, +// // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control +// { +// key: 'X-DNS-Prefetch-Control', +// value: 'on', +// }, +// // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security +// { +// key: 'Strict-Transport-Security', +// value: 'max-age=31536000; includeSubDomains', +// }, +// // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy +// { +// key: 'Permissions-Policy', +// value: 'camera=(), microphone=(), geolocation=()', +// }, +// ]; const nextConfig = { // ...options + output: 'export', webpack: (config) => { config.module.rules.push({ test: /\.svg$/, @@ -69,26 +70,27 @@ const nextConfig = { }, ], }, - async redirects() { - return [ - { - source: '/', - destination: '/collect', - permanent: true, - }, - ]; - }, + // async redirects() { + // return [ + // { + // source: '/', + // destination: '/collect', + // permanent: true, + // }, + // ]; + // }, - async headers() { - return [ - { - source: '/glogglogglog-env.eba-fuksumx7.ap-northeast-2.elasticbeanstalk.com', - headers: securityHeaders, - }, - ]; - }, + // async headers() { + // return [ + // { + // source: '/glogglogglog-env.eba-fuksumx7.ap-northeast-2.elasticbeanstalk.com', + // headers: securityHeaders, + // }, + // ]; + // }, }; module.exports = removeImports({ ...nextConfig, + output: 'export', }); diff --git a/client/package.json b/client/package.json index a0ef8863..9b457951 100644 --- a/client/package.json +++ b/client/package.json @@ -7,6 +7,7 @@ "dev": "next dev", "build": "next build", "start": "next start", + "export": "next export", "lint": "next lint" }, "dependencies": { diff --git a/client/src/app/[blogName]/scrap/page.tsx b/client/src/app/[blogName]/scrap/page.tsx index 3bb30cc5..399cb3c1 100644 --- a/client/src/app/[blogName]/scrap/page.tsx +++ b/client/src/app/[blogName]/scrap/page.tsx @@ -1,4 +1,5 @@ 'use client'; + import React, { useEffect } from 'react'; import PostComponent from '../../../components/Post/Post'; import { useState } from 'react'; @@ -10,7 +11,7 @@ import { IScrapContent } from '@/types/dto'; export default function Scrap() { const [page, setPage] = useState(0); - const { data } = useGetScrapQuery({ page: page }); + const { data } = useGetScrapQuery({ page }); const [result, setResult] = useState(); useEffect(() => {