This commit is contained in:
Benjamin Toby 2024-10-01 16:17:51 +01:00
parent a6a3b8056d
commit a3732103bf
3 changed files with 69 additions and 62 deletions

View File

@ -1,5 +1,5 @@
# Set Node.js version # Set Node.js version
FROM node:bookworm FROM node:alpine
RUN mkdir /app RUN mkdir /app
@ -8,8 +8,8 @@ WORKDIR /app
# Copy package.json and package-lock.json # Copy package.json and package-lock.json
RUN apt update RUN apk update
RUN apt install nano -y RUN apk add nano
RUN touch /root/.bashrc RUN touch /root/.bashrc
RUN echo 'alias ll="ls -laF"' > /root/.bashrc RUN echo 'alias ll="ls -laF"' > /root/.bashrc

View File

@ -56,6 +56,7 @@ export default async function BlogIndex({
}: { }: {
params: any; params: any;
}) { }) {
try {
//* Data fetching //* Data fetching
const post = await getPost({ single: single }); const post = await getPost({ single: single });
@ -72,4 +73,7 @@ export default async function BlogIndex({
); );
/** ********************************************** */ /** ********************************************** */
} catch (error) {
return redirect("/blog");
}
} }

View File

@ -4,8 +4,7 @@
import React from "react"; import React from "react";
import { Metadata } from "next"; import { Metadata } from "next";
const datasquirel = require("datasquirel"); const datasquirel = require("datasquirel");
import { redirect } from "next/navigation";
import { headers, cookies } from "next/headers";
///////////////////////////////////////////// /////////////////////////////////////////////
//* Metadata //* Metadata
@ -26,6 +25,7 @@ export const revalidate = 3600;
* ============================================================================== * ==============================================================================
*/ */
export default async function BlogIndex() { export default async function BlogIndex() {
try {
//* Data fetching //* Data fetching
///////////////////////////////////////////// /////////////////////////////////////////////
const postsResponse = await datasquirel.get({ const postsResponse = await datasquirel.get({
@ -74,4 +74,7 @@ export default async function BlogIndex() {
); );
/** ********************************************** */ /** ********************************************** */
} catch (error) {
return redirect("/");
}
} }