diff --git a/src/app/graphql.module.ts b/src/app/graphql.module.ts index eaee8ab..5632d0a 100644 --- a/src/app/graphql.module.ts +++ b/src/app/graphql.module.ts @@ -9,10 +9,16 @@ import { import { HttpLink } from 'apollo-angular/http'; import { environment } from '../environments/environment'; + const uri = environment.apiUrl + '/graphql'; // <-- add the URL of the GraphQL server here const authMiddleware = new ApolloLink((operation, forward) => { - //Add token here <------------------------------------------------------- + //Add token here TODO: use AuthService to get the Token + operation.setContext({ + headers: { + authorization: localStorage.getItem('requestToken') || null, + } + }); return forward(operation).map((data) => { return data; }); diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 15242f4..434f3ef 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,6 +4,8 @@ export const environment = { production: false, + //apiUrl: "http://localhost:4000", + //authUrl: "http://localhost:8080" apiUrl: "http://173.212.197.169:4000", authUrl: "http://173.212.197.169:8080" };