title: Accessing .ENV Properties with Angular2 Typescript and ServerJS
body: <p>I've been going through the Angular2 Quickstart and tutorials and now I'm trying to get set up pulling data from a live REST Api. I need to pass in authentication parameters with the Api call and everything I'm reading says I should be putting those parameters into the ENV variables.</p>
  
  <p>I can't work out exactly how I should be doing this. I've created a .env file on my local server, I've used NPM to instal dotenv to my project, but none of the examples I can find for how to use dotenv seem to fit with the TypeScript import syntax I'm used to.</p>
  
  <p>Here's my main.ts:</p>
  
  <pre><code>import { }              from 'dotenv/config';
  import { bootstrap }    from '@angular/platform-browser-dynamic';
  import { AppComponent } from './app.component';
  
  bootstrap(AppComponent);
  </code></pre>
  
  <p>And a sample app.component.ts:</p>
  
  <pre><code>import { Component } from '@angular/core';
  
  @Component({
    selector: 'my-app',
    template: `
      &lt;h1&gt;Up and running!&lt;/h1&gt;
      &lt;p&gt;Do not show this at home: {{process.env.TWITTER_CONSUMER_KEY}}&lt;/p&gt;
    `,
    styleUrls: ['style.css']
  })
  
  export class AppComponent { 
  
  }
  </code></pre>
  
  <p>Any help would be appreciated. I've been out of the coding loop for a while and this is all a bit new to me. </p>
  
  <p>Bonus question, would I still have the .env file when I go to a live server or does it change?</p>