Skip to content
This repository has been archived by the owner on May 31, 2019. It is now read-only.

Commit

Permalink
πŸ‘ update for new shopify-express api (#95)
Browse files Browse the repository at this point in the history
* πŸ‘ update for new shopify-express fixes

* βž• update to newest version of shopify-express

* πŸ“ update README

* πŸ‘Œ fix api path in client
  • Loading branch information
marutypes committed Mar 23, 2018
1 parent d03c175 commit 4a00124
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -34,7 +34,7 @@ This example app uses Node, Express, Webpack, React, Redux, and Shopify/polaris
- Sign into your [Shopify Partner Dashboard](https://partners.shopify.com/organizations)
- Click 'Apps' in the sidebar and create a new app
- Set the app url to `{{ HOST }}/`
- Set the whitelisted URL to `{{ HOST }}/auth/shopify/callback`
- Set the whitelisted URL to `{{ HOST }}/shopify/auth/callback`
- Go to extensions tab and enable β€œEmbed in Shopify admin”

### Configure and add to a store
Expand Down
2 changes: 1 addition & 1 deletion client/actions/index.js
Expand Up @@ -44,7 +44,7 @@ export function sendRequest(requestFields) {
return dispatch => {
dispatch(requestStartAction());

return fetch(`/api${path}`, fetchOptions)
return fetch(`/shopify/api${path}`, fetchOptions)
.then(response => response.json())
.then(json => dispatch(requestCompleteAction(json)))
.catch(error => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -26,7 +26,7 @@
],
"dependencies": {
"@shopify/polaris": "^1.8.3",
"@shopify/shopify-express": "^1.0.0-alpha.6",
"@shopify/shopify-express": "^1.0.0-alpha.7",
"chalk": "^1.1.3",
"connect-redis": "^3.3.0",
"cross-env": "^5.1.3",
Expand Down
4 changes: 2 additions & 2 deletions server/index.js
Expand Up @@ -101,10 +101,10 @@ const shopify = ShopifyExpress(shopifyConfig);
const {routes, middleware} = shopify;
const {withShop, withWebhook} = middleware;

app.use('/', routes);
app.use('/shopify', routes);

// Client
app.get('/', withShop, function(request, response) {
app.get('/', withShop({authBaseUrl: '/shopify'}), function(request, response) {
const { session: { shop, accessToken } } = request;
response.render('app', {
title: 'Shopify Node App',
Expand Down
2 changes: 1 addition & 1 deletion server/views/install.ejs
Expand Up @@ -72,7 +72,7 @@
</header>

<div class="container__form">
<form method="GET" action="auth/shopify">
<form method="GET" action="/shopify/auth">
<input type="text" name="shop" id="shop" placeholder="example.myshopify.com"/>
<button type="submit">Install</button>
</form>
Expand Down
64 changes: 47 additions & 17 deletions yarn.lock
Expand Up @@ -55,16 +55,17 @@
core-js "^2.4.1"
react-addons-transition-group "^15.4.2"

"@shopify/shopify-express@^1.0.0-alpha.6":
version "1.0.0-alpha.6"
resolved "https://registry.yarnpkg.com/@shopify/shopify-express/-/shopify-express-1.0.0-alpha.6.tgz#071f5c1a293de7c79326e02ebb49ac1ce2750ae4"
"@shopify/shopify-express@^1.0.0-alpha.7":
version "1.0.0-alpha.7"
resolved "https://registry.yarnpkg.com/@shopify/shopify-express/-/shopify-express-1.0.0-alpha.7.tgz#3cda42038cec51ae2be4543cabb952520c3bf0eb"
dependencies:
body-parser "^1.18.2"
connect-redis "^3.3.0"
express "^4.16.2"
express-session "^1.15.3"
knex "^0.13.0"
node-fetch "^1.7.3"
prop-types "^15.6.1"
raw-body "^2.3.2"
redis "^2.7.1"
sqlite3 "^3.1.9"
Expand Down Expand Up @@ -121,13 +122,20 @@ abbrev@1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"

accepts@~1.3.3, accepts@~1.3.4:
accepts@~1.3.3:
version "1.3.4"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.4.tgz#86246758c7dd6d21a6474ff084a4740ec05eb21f"
dependencies:
mime-types "~2.1.16"
negotiator "0.6.1"

accepts@~1.3.4:
version "1.3.5"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2"
dependencies:
mime-types "~2.1.18"
negotiator "0.6.1"

acorn-dynamic-import@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4"
Expand Down Expand Up @@ -1689,10 +1697,14 @@ delegates@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"

depd@1.1.1, depd@~1.1.0, depd@~1.1.1:
depd@1.1.1, depd@~1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359"

depd@~1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"

des.js@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc"
Expand Down Expand Up @@ -1814,8 +1826,8 @@ emojis-list@^2.0.0:
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389"

encodeurl@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20"
version "1.0.2"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"

encoding@^0.1.11:
version "0.1.12"
Expand Down Expand Up @@ -2812,9 +2824,9 @@ ipaddr.js@1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.4.0.tgz#296aca878a821816e5b85d0a285a99bcff4582f0"

ipaddr.js@1.5.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.5.2.tgz#d4b505bde9946987ccf0fc58d9010ff9607e3fa0"
ipaddr.js@1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.6.0.tgz#e3fa357b773da619f26e95f049d055c72796f86b"

is-absolute-url@^2.0.0:
version "2.1.0"
Expand Down Expand Up @@ -3391,12 +3403,22 @@ mime-db@~1.30.0:
version "1.30.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01"

mime-types@^2.1.12, mime-types@~2.1.15, mime-types@~2.1.16, mime-types@~2.1.17, mime-types@~2.1.7:
mime-db@~1.33.0:
version "1.33.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db"

mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.7:
version "2.1.17"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a"
dependencies:
mime-db "~1.30.0"

mime-types@~2.1.16, mime-types@~2.1.18:
version "2.1.18"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8"
dependencies:
mime-db "~1.33.0"

mime@1.3.4:
version "1.3.4"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53"
Expand Down Expand Up @@ -4179,6 +4201,14 @@ prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.8,
loose-envify "^1.3.1"
object-assign "^4.1.1"

prop-types@^15.6.1:
version "15.6.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca"
dependencies:
fbjs "^0.8.16"
loose-envify "^1.3.1"
object-assign "^4.1.1"

proxy-addr@~1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.5.tgz#71c0ee3b102de3f202f3b64f608d173fcba1a918"
Expand All @@ -4187,11 +4217,11 @@ proxy-addr@~1.1.5:
ipaddr.js "1.4.0"

proxy-addr@~2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.2.tgz#6571504f47bb988ec8180253f85dd7e14952bdec"
version "2.0.3"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341"
dependencies:
forwarded "~0.1.2"
ipaddr.js "1.5.2"
ipaddr.js "1.6.0"

prr@~0.0.0:
version "0.0.0"
Expand Down Expand Up @@ -5223,11 +5253,11 @@ type-check@~0.3.2:
prelude-ls "~1.1.2"

type-is@~1.6.15:
version "1.6.15"
resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.15.tgz#cab10fb4909e441c82842eafe1ad646c81804410"
version "1.6.16"
resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194"
dependencies:
media-typer "0.3.0"
mime-types "~2.1.15"
mime-types "~2.1.18"

typedarray@^0.0.6:
version "0.0.6"
Expand Down

0 comments on commit 4a00124

Please sign in to comment.