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
FROM node:bookworm
FROM node:alpine
RUN mkdir /app
@ -8,8 +8,8 @@ WORKDIR /app
# Copy package.json and package-lock.json
RUN apt update
RUN apt install nano -y
RUN apk update
RUN apk add nano
RUN touch /root/.bashrc
RUN echo 'alias ll="ls -laF"' > /root/.bashrc

View File

@ -56,6 +56,7 @@ export default async function BlogIndex({
}: {
params: any;
}) {
try {
//* Data fetching
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 { Metadata } from "next";
const datasquirel = require("datasquirel");
import { headers, cookies } from "next/headers";
import { redirect } from "next/navigation";
/////////////////////////////////////////////
//* Metadata
@ -26,6 +25,7 @@ export const revalidate = 3600;
* ==============================================================================
*/
export default async function BlogIndex() {
try {
//* Data fetching
/////////////////////////////////////////////
const postsResponse = await datasquirel.get({
@ -74,4 +74,7 @@ export default async function BlogIndex() {
);
/** ********************************************** */
} catch (error) {
return redirect("/");
}
}