diff --git a/applications/dotnet/src/WebUI/otel-collector-config.yml b/applications/dotnet/src/WebUI/otel-collector-config.yml index 0cc6e3f85..1e234dd88 100644 --- a/applications/dotnet/src/WebUI/otel-collector-config.yml +++ b/applications/dotnet/src/WebUI/otel-collector-config.yml @@ -13,8 +13,8 @@ exporters: authenticator: sigv4auth awsxray: region: us-east-1 - logging: - loglevel: debug + debug: + verbosity: detailed extensions: sigv4auth: region: us-east-1 diff --git a/applications/next-js/Dockerfile b/applications/next-js/Dockerfile index 1fb1a3cd0..8a6b22529 100644 --- a/applications/next-js/Dockerfile +++ b/applications/next-js/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18-alpine AS base +FROM node:20-alpine AS base # Install dependencies only when needed FROM base AS deps @@ -9,11 +9,11 @@ WORKDIR /app # Install dependencies based on the preferred package manager COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ RUN \ - if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ - elif [ -f package-lock.json ]; then npm ci; \ - elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \ - else echo "Lockfile not found." && exit 1; \ - fi + if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ + elif [ -f package-lock.json ]; then npm ci; \ + elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \ + else echo "Lockfile not found." && exit 1; \ + fi # Rebuild the source code only when needed @@ -28,11 +28,11 @@ COPY . . ENV NEXT_TELEMETRY_DISABLED=1 RUN \ - if [ -f yarn.lock ]; then yarn run build; \ - elif [ -f package-lock.json ]; then npm run build; \ - elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \ - else echo "Lockfile not found." && exit 1; \ - fi + if [ -f yarn.lock ]; then yarn run build; \ + elif [ -f package-lock.json ]; then npm run build; \ + elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \ + else echo "Lockfile not found." && exit 1; \ + fi # Production image, copy all the files and run next FROM base AS runner @@ -65,4 +65,4 @@ ENV PORT=8080 # server.js is created by next build from the standalone output # https://nextjs.org/docs/pages/api-reference/next-config-js/output ENV HOSTNAME="0.0.0.0" -CMD ["node", "server.js"] \ No newline at end of file +CMD ["node", "server.js"] diff --git a/applications/next-js/app/[page]/page.tsx b/applications/next-js/app/[page]/page.tsx index f7b8b4683..2bd265106 100644 --- a/applications/next-js/app/[page]/page.tsx +++ b/applications/next-js/app/[page]/page.tsx @@ -1,15 +1,11 @@ -import Prose from "components/prose"; -import { getPage } from "lib/dynamo"; -import { notFound } from "next/navigation"; +import Prose from 'components/prose'; +import { getPage } from 'lib/dynamo'; +import { notFound } from 'next/navigation'; export default async function Page({ params }: { params: { page: string } }) { const page = await getPage(params.page); - if (!page) return notFound(); + if (!page || page instanceof Error) return notFound(); - return ( - <> - - - ); + return <>; } diff --git a/applications/next-js/app/backend-down.tsx b/applications/next-js/app/backend-down.tsx new file mode 100644 index 000000000..7420502fb --- /dev/null +++ b/applications/next-js/app/backend-down.tsx @@ -0,0 +1,17 @@ +import React from 'react'; + +export default function NotFound() { + return ( +
+
+
+

500

+
+

+ Looks like the backend is down, please deploy it and try again! +

+
+
+
+ ); +} diff --git a/applications/next-js/app/page.tsx b/applications/next-js/app/page.tsx index bb329b6ba..aa3648cf1 100644 --- a/applications/next-js/app/page.tsx +++ b/applications/next-js/app/page.tsx @@ -1,6 +1,6 @@ -import Footer from "components/layout/footer"; -import { Carousel } from "components/carousel"; -import { ThreeItemGrid } from "components/grid/three-items"; +import Footer from 'components/layout/footer'; +import { Carousel } from 'components/carousel'; +import { ThreeItemGrid } from 'components/grid/three-items'; export default async function HomePage() { return ( diff --git a/applications/next-js/app/product/[handle]/page.tsx b/applications/next-js/app/product/[handle]/page.tsx index 048f89701..54a2f8023 100644 --- a/applications/next-js/app/product/[handle]/page.tsx +++ b/applications/next-js/app/product/[handle]/page.tsx @@ -1,30 +1,27 @@ -import { notFound } from "next/navigation"; +import { notFound } from 'next/navigation'; -import { GridTileImage } from "components/grid/tile"; -import Footer from "components/layout/footer"; -import { Gallery } from "components/product/gallery"; -import { ProductDescription } from "components/product/product-description"; -import { HIDDEN_PRODUCT_TAG } from "lib/constants"; -import { getProduct } from "lib/dynamo"; -import { Image } from "lib/dynamo/types"; -import Link from "next/link"; -import { Suspense } from "react"; +import { GridTileImage } from 'components/grid/tile'; +import Footer from 'components/layout/footer'; +import { Gallery } from 'components/product/gallery'; +import { ProductDescription } from 'components/product/product-description'; +import { HIDDEN_PRODUCT_TAG } from 'lib/constants'; +import { getProduct } from 'lib/dynamo'; +import { Image } from 'lib/dynamo/types'; +import Link from 'next/link'; +import { Suspense } from 'react'; +import NotFound from 'app/backend-down'; -export default async function ProductPage({ - params, -}: { - params: { handle: string }; -}) { +export default async function ProductPage({ params }: { params: { handle: string } }) { const product = await getProduct(params.handle); - if (!product) return notFound(); + if (!product || product instanceof Error) return NotFound(); const productJsonLd = { - "@context": "https://schema.org", - "@type": "Product", + '@context': 'https://schema.org', + '@type': 'Product', name: product.name, description: product.description, - image: product.images, + image: product.images }; return ( @@ -32,7 +29,7 @@ export default async function ProductPage({