mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 05:56:59 +00:00
feat(poc): cahnge runtime for test
This commit is contained in:
parent
09ecbe89e3
commit
179b92d5d8
@ -4,15 +4,11 @@ import Prose from 'components/prose';
|
|||||||
import { getPage } from 'lib/shopware';
|
import { getPage } from 'lib/shopware';
|
||||||
import { notFound } from 'next/navigation';
|
import { notFound } from 'next/navigation';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'nodejs';
|
||||||
|
|
||||||
export const revalidate = 43200; // 12 hours in seconds
|
export const revalidate = 43200; // 12 hours in seconds
|
||||||
|
|
||||||
export async function generateMetadata({
|
export async function generateMetadata({ params }: { params: { cms: string } }): Promise<Metadata> {
|
||||||
params
|
|
||||||
}: {
|
|
||||||
params: { cms: string };
|
|
||||||
}): Promise<Metadata> {
|
|
||||||
const page = await getPage(params.cms);
|
const page = await getPage(params.cms);
|
||||||
|
|
||||||
if (!page) return notFound();
|
if (!page) return notFound();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import OpengraphImage from 'components/opengraph-image';
|
import OpengraphImage from 'components/opengraph-image';
|
||||||
import { getPage } from 'lib/shopware';
|
import { getPage } from 'lib/shopware';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'nodejs';
|
||||||
|
|
||||||
export default async function Image({ params }: { params: { page: string } }) {
|
export default async function Image({ params }: { params: { page: string } }) {
|
||||||
const page = await getPage(params.page);
|
const page = await getPage(params.page);
|
||||||
|
@ -3,7 +3,7 @@ import { revalidateTag } from 'next/cache';
|
|||||||
import { headers } from 'next/headers';
|
import { headers } from 'next/headers';
|
||||||
import { NextRequest, NextResponse } from 'next/server';
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'nodejs';
|
||||||
|
|
||||||
// We always need to respond with a 200 status code to Shopify,
|
// We always need to respond with a 200 status code to Shopify,
|
||||||
// otherwise it will continue to retry the request.
|
// otherwise it will continue to retry the request.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import OpengraphImage from 'components/opengraph-image';
|
import OpengraphImage from 'components/opengraph-image';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'nodejs';
|
||||||
|
|
||||||
export default async function Image() {
|
export default async function Image() {
|
||||||
return await OpengraphImage();
|
return await OpengraphImage();
|
||||||
|
@ -3,7 +3,7 @@ import { ThreeItemGrid } from 'components/grid/three-items';
|
|||||||
import Footer from 'components/layout/footer';
|
import Footer from 'components/layout/footer';
|
||||||
import { Suspense } from 'react';
|
import { Suspense } from 'react';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'nodejs';
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
description: 'High-performance ecommerce store built with Next.js, Vercel, and Shopware.',
|
description: 'High-performance ecommerce store built with Next.js, Vercel, and Shopware.',
|
||||||
|
@ -13,7 +13,7 @@ import { HIDDEN_PRODUCT_TAG } from 'lib/constants';
|
|||||||
import { getProduct, getProductRecommendations } from 'lib/shopware';
|
import { getProduct, getProductRecommendations } from 'lib/shopware';
|
||||||
import { Image } from 'lib/shopware/types';
|
import { Image } from 'lib/shopware/types';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'nodejs';
|
||||||
|
|
||||||
export async function generateMetadata({
|
export async function generateMetadata({
|
||||||
params
|
params
|
||||||
|
@ -10,7 +10,7 @@ import Pagination from 'components/collection/pagination';
|
|||||||
import { getCollection, getCollectionProducts } from 'lib/shopware';
|
import { getCollection, getCollectionProducts } from 'lib/shopware';
|
||||||
import { defaultSort, sorting } from 'lib/constants';
|
import { defaultSort, sorting } from 'lib/constants';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'nodejs';
|
||||||
|
|
||||||
export async function generateMetadata({
|
export async function generateMetadata({
|
||||||
params
|
params
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import OpengraphImage from 'components/opengraph-image';
|
import OpengraphImage from 'components/opengraph-image';
|
||||||
import { getCollection } from 'lib/shopware';
|
import { getCollection } from 'lib/shopware';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'nodejs';
|
||||||
|
|
||||||
export default async function Image({ params }: { params: { collection: string } }) {
|
export default async function Image({ params }: { params: { collection: string } }) {
|
||||||
const collection = await getCollection(params.collection);
|
const collection = await getCollection(params.collection);
|
||||||
|
@ -4,7 +4,7 @@ import FilterList from 'components/layout/search/filter';
|
|||||||
import { defaultSort, sorting } from 'lib/constants';
|
import { defaultSort, sorting } from 'lib/constants';
|
||||||
import { getSearchCollectionProducts } from 'lib/shopware';
|
import { getSearchCollectionProducts } from 'lib/shopware';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'nodejs';
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
title: 'Search',
|
title: 'Search',
|
||||||
@ -23,16 +23,17 @@ export default async function SearchPage({
|
|||||||
const resultsText = products.length > 1 ? 'results' : 'result';
|
const resultsText = products.length > 1 ? 'results' : 'result';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>{searchValue && products.length === 0 ? (
|
<>
|
||||||
<div className='mx-auto flex max-w-7xl flex-col bg-white py-6 text-black dark:bg-black dark:text-white md:flex-row'>
|
{searchValue && products.length === 0 ? (
|
||||||
<p>
|
<div className="mx-auto flex max-w-7xl flex-col bg-white py-6 text-black dark:bg-black dark:text-white md:flex-row">
|
||||||
{'There are no products that match '}
|
<p>
|
||||||
<span className="font-bold">"{searchValue}"</span>
|
{'There are no products that match '}
|
||||||
</p>
|
<span className="font-bold">"{searchValue}"</span>
|
||||||
</div>
|
</p>
|
||||||
) : null}
|
</div>
|
||||||
|
) : null}
|
||||||
{products.length > 0 ? (
|
{products.length > 0 ? (
|
||||||
<div className='mx-auto flex max-w-7xl flex-col bg-white py-6 text-black dark:bg-black dark:text-white md:flex-row'>
|
<div className="mx-auto flex max-w-7xl flex-col bg-white py-6 text-black dark:bg-black dark:text-white md:flex-row">
|
||||||
<div className="order-first flex-none md:w-1/6">
|
<div className="order-first flex-none md:w-1/6">
|
||||||
{searchValue ? (
|
{searchValue ? (
|
||||||
<p>
|
<p>
|
||||||
@ -40,7 +41,7 @@ export default async function SearchPage({
|
|||||||
<span className="font-bold">"{searchValue}"</span>
|
<span className="font-bold">"{searchValue}"</span>
|
||||||
</p>
|
</p>
|
||||||
) : null}
|
) : null}
|
||||||
<p className='pt-4'>Good place to add other suggest search terms ;)</p>
|
<p className="pt-4">Good place to add other suggest search terms ;)</p>
|
||||||
</div>
|
</div>
|
||||||
<Grid className="grid-cols-2 lg:grid-cols-3">
|
<Grid className="grid-cols-2 lg:grid-cols-3">
|
||||||
<ProductGridItems products={products} />
|
<ProductGridItems products={products} />
|
||||||
|
@ -105,7 +105,6 @@ export async function requestSeoUrl(
|
|||||||
page: number = 1,
|
page: number = 1,
|
||||||
limit: number = 1
|
limit: number = 1
|
||||||
): Promise<SeoURLResultSW> {
|
): Promise<SeoURLResultSW> {
|
||||||
const fixedHandle = handle.replace('%2F', '/');
|
|
||||||
return await apiInstance.invoke('readSeoUrl post /seo-url', {
|
return await apiInstance.invoke('readSeoUrl post /seo-url', {
|
||||||
page: page,
|
page: page,
|
||||||
limit: limit,
|
limit: limit,
|
||||||
@ -118,12 +117,12 @@ export async function requestSeoUrl(
|
|||||||
{
|
{
|
||||||
type: 'equals',
|
type: 'equals',
|
||||||
field: 'seoPathInfo',
|
field: 'seoPathInfo',
|
||||||
value: fixedHandle + '/'
|
value: handle + '/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'equals',
|
type: 'equals',
|
||||||
field: 'seoPathInfo',
|
field: 'seoPathInfo',
|
||||||
value: fixedHandle
|
value: handle
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user