I have some text in the form of some JSON that I have been able to pull from Steam's Web API using my server written in ExpressJS/nodeJS. This JSON is stored in a variable.
What I am trying to do here is to basically take the JSON that I have stored in a variable, send it to my Angular and then display the data onto my page.
When I do, my console shows the raw HTML of the page.
Is there something that I am missing?
My node:
app.get('/steam.html', function(req, res){
request.get(steam_api, function(error, steamResponse, steamBody) {
var steamList = JSON.parse(steamBody);
gameList = steamList["applist"]["apps"];
res.json({gl: gameList});
});
});
My angular:
$http.get('steam.html').success(function(data){
$scope.gameList = data;
console.log(data);
});
My steam.html
<body ng-app="gameSearch" ng-controller="gameSearchController">
<p>{{title}}</p>
<ul ng-repeat="steam in gameList track by $index">
<li>{{steam.name}}</li>
</ul>
</body>
Edit: If it helps here's a screenshot of what I am seeing. As you will see I am getting a bunch of bullet points back but not the names of each game.
Express JS passes bullet points
Edit 2: Another thing I should add for clarity is that I used some nodeJS code that I found on a blogpost from codepen as shown below (https://codepen.io/johnchristopherjones/post/how-do-i-use-the-steam-api-in-my-web-app):
app.get('/steam/game/:appid/achievements', function(httpRequest, httpResponse) {
// Calculate the Steam API URL we want to use
var url = 'http://api.steampowered.com/ISteamUserStats/GetSchemaForGame/' +
'v2/?key=YOURSTEAMAPIKEYHERE&appid=' +
httpRequest.params.appid;
request.get(url, function(error, steamHttpResponse, steamHttpBody) {
httpResponse.setHeader('Content-Type', 'application/json');
httpResponse.send(steamHttpBody);
});
});