Skip to content

Commit

Permalink
Attempt to fix netlify deploy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Jan 19, 2022
1 parent edad5f1 commit 7abd6aa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ schema.graphql

/.cache
/build
/netlify/functions/server/build
/public/build
/app/styles/global.css
.env
Expand Down
9 changes: 1 addition & 8 deletions app/commerce.server.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import { createShopifyProvider } from "./models/ecommerce-providers/shopify.server";
import { createSwrRedisCache } from "./models/request-response-caches/swr-redis-cache.server";

import redisClient from "./redis.server";
import { createVendureProvider } from '~/models/ecommerce-providers/vendure.server';

let commerce = createVendureProvider({
shop: process.env.SHOPIFY_STORE!,
maxAgeSeconds: 60,
});
let commerce = createVendureProvider({});

export default commerce;
17 changes: 1 addition & 16 deletions app/models/ecommerce-providers/vendure.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@ import { getTranslations } from "~/translations.server";

export interface VendureProviderOptions {
cache?: RequestResponseCache;
maxAgeSeconds?: number | ((request: Request) => number);
shop: string;
}

export function createVendureProvider({
cache,
maxAgeSeconds,
shop,
}: VendureProviderOptions): EcommerceProvider {
export function createVendureProvider({ cache }: VendureProviderOptions): EcommerceProvider {
let href = process.env.VENDURE_API_URL || `https://demo.vendure.io/shop-api`;

async function query(
Expand All @@ -40,15 +34,6 @@ export function createVendureProvider({
body: JSON.stringify({query, variables}),
});

let maxAge =
typeof maxAgeSeconds === "function"
? maxAgeSeconds(request.clone())
: maxAgeSeconds;

if (!nocache && cache && typeof maxAge === "number") {
return cache(request, maxAge).then((res) => res.json());
}

const result = await fetch(request).then((res) => res.json());
if (result.errors?.length) {
throw new Error(result.errors[0].message);
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build]
command = "remix build"
command = "npm build"
functions = "netlify/functions"
publish = "public"

Expand Down

0 comments on commit 7abd6aa

Please sign in to comment.