Skip to content

Commit

Permalink
config 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaeyeon1 committed Nov 28, 2023
1 parent 1d9e14c commit 50a6fa0
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 56 deletions.
112 changes: 57 additions & 55 deletions client/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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$/,
Expand All @@ -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',
});
1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"export": "next export",
"lint": "next lint"
},
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion client/src/app/[blogName]/scrap/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import React, { useEffect } from 'react';
import PostComponent from '../../../components/Post/Post';
import { useState } from 'react';
Expand All @@ -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<IScrapContent[]>();

useEffect(() => {
Expand Down

0 comments on commit 50a6fa0

Please sign in to comment.