Skip to content

Commit

Permalink
WIP: attempting to read in env, javascript/angaular is defintely not …
Browse files Browse the repository at this point in the history
…what i know
  • Loading branch information
robinsonkwame committed May 3, 2018
1 parent 229ad0b commit e1bd9bd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/app/skill-labeller/labels.services.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { environment} from '../../environments/environment'

export class LabelsService {
putCandidateLabelEndpoint = '';
getCandidateEndpoint = '';
dispatcherEndpoint = new URL("http://" + environment.dispatcher_host + ":" + environment.dispatcher_port);

getCandidateEndpoint = URL(environment.dispatcher_get, dispatcherEndpoint);
putCandidateEndpoint = URL(environment.dispatcher_put, dispatcherEndpoint);

dispatcher = 'https://jsonplaceholder.typicode.com/posts/1';
data = {
method: 'post',
Expand Down
4 changes: 3 additions & 1 deletion src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const environment = {
production: true
production: true,
dispatcher_host: "${process.env.DISPATCHER_HOST}",
dispatcher_port: "${process.env.DISPATCHER_PORT}",
};
4 changes: 3 additions & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
// The list of which env maps to which file can be found in `.angular-cli.json`.

export const environment = {
production: false
production: false,
dispatcher_host: "${process.env.DISPATCHER_HOST}",
dispatcher_port: "${process.env.DISPATCHER_PORT}",
};
2 changes: 1 addition & 1 deletion standalone/dispatcher.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DISPATCHER_HOST=localhost
DISPATCHER_POST=8000
DISPATCHER_PORT=8000

0 comments on commit e1bd9bd

Please sign in to comment.