Skip to content

Commit

Permalink
Merge pull request #41 from AlexTasev/feat/move-to-https-uri
Browse files Browse the repository at this point in the history
feat: the api's https address is used
  • Loading branch information
AlexTasev authored Nov 11, 2019
2 parents 3e4ea37 + 99d08e3 commit 734ced4
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 41 deletions.
File renamed without changes.
76 changes: 56 additions & 20 deletions react-masterclass/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 13 additions & 21 deletions react-masterclass/src/client/index.js
Original file line number Diff line number Diff line change
@@ -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;
export default client;

0 comments on commit 734ced4

Please sign in to comment.