Skip to content

Commit

Permalink
Add Vendure provider
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Jan 19, 2022
1 parent 49cb32b commit be04dbe
Show file tree
Hide file tree
Showing 4 changed files with 533 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.DS_Store
node_modules
.idea
schema.graphql

/.cache
/build
Expand All @@ -9,4 +11,4 @@ node_modules

/cypress/videos
/cypress/screenshots
/runner-results
/runner-results
15 changes: 15 additions & 0 deletions .graphqlconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Untitled GraphQL Schema",
"schemaPath": "schema.graphql",
"extensions": {
"endpoints": {
"Default GraphQL Endpoint": {
"url": "https://demo.vendure.io/shop-api",
"headers": {
"user-agent": "JS GraphQL"
},
"introspect": false
}
}
}
}
10 changes: 2 additions & 8 deletions app/commerce.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@ import { createShopifyProvider } from "./models/ecommerce-providers/shopify.serv
import { createSwrRedisCache } from "./models/request-response-caches/swr-redis-cache.server";

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

if (!process.env.SHOPIFY_STOREFRONT_ACCESS_TOKEN) {
throw new Error(
"SHOPIFY_STOREFRONT_ACCESS_TOKEN environment variable is not set"
);
}

let commerce = createShopifyProvider({
let commerce = createVendureProvider({
shop: process.env.SHOPIFY_STORE!,
storefrontAccessToken: process.env.SHOPIFY_STOREFRONT_ACCESS_TOKEN,
maxAgeSeconds: 60,
cache: createSwrRedisCache({
redisClient,
Expand Down
Loading

0 comments on commit be04dbe

Please sign in to comment.