From 99d08e32cd3d9153c1ea594e2124f3437102179e Mon Sep 17 00:00:00 2001 From: AlexTasev Date: Mon, 11 Nov 2019 12:12:22 +0200 Subject: [PATCH] feat: the api's https address is used --- .../netlify.toml => netlify.toml | 0 react-masterclass/package-lock.json | 76 ++++++++++++++----- react-masterclass/src/client/index.js | 34 ++++----- 3 files changed, 69 insertions(+), 41 deletions(-) rename react-masterclass/netlify.toml => netlify.toml (100%) diff --git a/react-masterclass/netlify.toml b/netlify.toml similarity index 100% rename from react-masterclass/netlify.toml rename to netlify.toml diff --git a/react-masterclass/package-lock.json b/react-masterclass/package-lock.json index e974726..dfde512 100644 --- a/react-masterclass/package-lock.json +++ b/react-masterclass/package-lock.json @@ -3668,7 +3668,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -3686,11 +3687,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3703,15 +3706,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -3814,7 +3820,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -3824,6 +3831,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3836,17 +3844,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -3863,6 +3874,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -3935,7 +3947,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -3945,6 +3958,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4020,7 +4034,8 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -4050,6 +4065,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4067,6 +4083,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4105,11 +4122,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.0.3", - "bundled": true + "bundled": true, + "optional": true } } }, @@ -8848,7 +8867,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -8872,6 +8892,7 @@ "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -8884,7 +8905,8 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", @@ -8893,7 +8915,8 @@ }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -8996,7 +9019,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -9006,6 +9030,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -9018,17 +9043,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.3.5", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -9045,6 +9073,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -9117,7 +9146,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -9127,6 +9157,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -9202,7 +9233,8 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -9232,6 +9264,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -9249,6 +9282,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -9287,11 +9321,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.0.3", - "bundled": true + "bundled": true, + "optional": true } } } diff --git a/react-masterclass/src/client/index.js b/react-masterclass/src/client/index.js index 3c8651b..35329eb 100644 --- a/react-masterclass/src/client/index.js +++ b/react-masterclass/src/client/index.js @@ -1,32 +1,24 @@ -import { - ApolloClient -} from 'apollo-client'; -import { - InMemoryCache -} from 'apollo-cache-inmemory'; -import { - createHttpLink -} from 'apollo-link-http'; -import { - typeDefs -} from './local'; +import { ApolloClient } from 'apollo-client'; +import { InMemoryCache } from 'apollo-cache-inmemory'; +import { createHttpLink } from 'apollo-link-http'; +import { typeDefs } from './local'; import authLink from './auth'; const httpLink = createHttpLink({ - uri: 'http://softuni-swapp-212366186.eu-west-1.elb.amazonaws.com/graphql' + uri: 'https://swapp.st6.io/graphql', }); const cache = new InMemoryCache(); const client = new ApolloClient({ - cache, - link: authLink.concat(httpLink), - typeDefs -}) + cache, + link: authLink.concat(httpLink), + typeDefs, +}); cache.writeData({ - data: { - authenticated: !!localStorage.getItem('token'), - }, + data: { + authenticated: !!localStorage.getItem('token'), + }, }); -export default client; \ No newline at end of file +export default client;