mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Adds environment variable validation (#1198)
* Adds environment variable validation * Adds bracket checking in SHOPIFY_STORE_DOMAIN * Prettier * Adds link --------- Co-authored-by: Lee Robinson <lrobinson2011@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { getCollections, getPages, getProducts } from 'lib/shopify';
|
||||
import { validateEnvironmentVariables } from 'lib/utils';
|
||||
import { MetadataRoute } from 'next';
|
||||
|
||||
type Route = {
|
||||
@@ -11,6 +12,8 @@ const baseUrl = process.env.NEXT_PUBLIC_VERCEL_URL
|
||||
: 'http://localhost:3000';
|
||||
|
||||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||
validateEnvironmentVariables();
|
||||
|
||||
const routesMap = [''].map((route) => ({
|
||||
url: `${baseUrl}${route}`,
|
||||
lastModified: new Date().toISOString()
|
||||
|
Reference in New Issue
Block a user