I'm trying to call a Heroku environment variable in a Node/Express app.
I set the env variable in Heroku using
heroku config:set GITHUB_TOKEN=<my github api token without quotation marks>
It is set correctly (I checked by running heroku config)
gitUserSearchController.js:
githubUserSearch.controller('GitUserSearchController', ['$resource', function($resource) {
var self = this;
var searchResource = $resource('https://api.github.com/search/users/');
var githubToken=process.env.GITHUB_TOKEN;
self.doSearch = function() {
self.searchResult = searchResource.get(
{ q: self.searchTerm, access_token: githubToken }
);
};
}]);
I get a console error readout of "Reference error: process is not defined" from line 5.