docker file
This commit is contained in:
+31
-31
@@ -17,37 +17,37 @@ const nextConfig: NextConfig = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// headers: async () => [
|
headers: async () => [
|
||||||
// {
|
{
|
||||||
// source: "/:path*",
|
source: "/:path*",
|
||||||
// headers: [
|
headers: [
|
||||||
// {
|
{
|
||||||
// key: "X-DNS-Prefetch-Control",
|
key: "X-DNS-Prefetch-Control",
|
||||||
// value: "on",
|
value: "on",
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// key: "Strict-Transport-Security",
|
key: "Strict-Transport-Security",
|
||||||
// value: "max-age=63072000; includeSubDomains; preload",
|
value: "max-age=63072000; includeSubDomains; preload",
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// key: "X-XSS-Protection",
|
key: "X-XSS-Protection",
|
||||||
// value: "1; mode=block",
|
value: "1; mode=block",
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// key: "X-Frame-Options",
|
key: "X-Frame-Options",
|
||||||
// value: "SAMEORIGIN",
|
value: "SAMEORIGIN",
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// key: "X-Content-Type-Options",
|
key: "X-Content-Type-Options",
|
||||||
// value: "nosniff",
|
value: "nosniff",
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// key: "Referrer-Policy",
|
key: "Referrer-Policy",
|
||||||
// value: "origin-when-cross-origin",
|
value: "origin-when-cross-origin",
|
||||||
// },
|
},
|
||||||
// ],
|
],
|
||||||
// },
|
},
|
||||||
// ],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|||||||
+12
-12
@@ -1,24 +1,24 @@
|
|||||||
import { Suspense } from 'react'
|
import { Suspense } from 'react'
|
||||||
import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query'
|
import { dehydrate, HydrationBoundary, QueryClient } from '@tanstack/react-query'
|
||||||
import { blogSingleQueryOptions } from '../hooks/useBlogsData'
|
import { blogSingleQueryOptions, mostVisitedBlogsQueryOptions } from '../hooks/useBlogsData'
|
||||||
import { NextPage } from 'next'
|
import { NextPage } from 'next'
|
||||||
import SingleBlogPage from '../components/SingleBlogPage'
|
import SingleBlogPage from '../components/SingleBlogPage'
|
||||||
import Loading from './loading'
|
import Loading from './loading'
|
||||||
|
|
||||||
// interface PageProps {
|
interface PageProps {
|
||||||
// params: Promise<{
|
params: Promise<{
|
||||||
// id: string
|
id: string
|
||||||
// }>
|
}>
|
||||||
// }
|
}
|
||||||
|
|
||||||
const SingleBlog: NextPage = async () => {
|
const SingleBlog: NextPage<PageProps> = async ({ params }) => {
|
||||||
|
|
||||||
// const { id } = await params
|
const { id } = await params
|
||||||
// console.log("loading", id);
|
console.log("loading", id);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<Loading />}>
|
<Suspense fallback={<Loading />}>
|
||||||
<BlogContent id={'7539fa00-e8e0-4b2b-a4b5-655284b5e8a1'} />
|
<BlogContent id={id} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -28,8 +28,8 @@ async function BlogContent({ id }: { id: string }) {
|
|||||||
const queryClient = new QueryClient()
|
const queryClient = new QueryClient()
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
queryClient.prefetchQuery(blogSingleQueryOptions('7539fa00-e8e0-4b2b-a4b5-655284b5e8a1')),
|
queryClient.prefetchQuery(blogSingleQueryOptions(id)),
|
||||||
// queryClient.prefetchQuery(mostVisitedBlogsQueryOptions)
|
queryClient.prefetchQuery(mostVisitedBlogsQueryOptions)
|
||||||
])
|
])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user