Added steam profile lookup API endpoint

This commit is contained in:
Luke Barratt 2014-08-28 21:43:11 +01:00
parent b97b3173bc
commit 4b9f2e6d84
6 changed files with 47 additions and 11 deletions

View file

@ -1,5 +1,17 @@
class Api::V1::UsersController < Api::V1::BaseController
def index
respond_with Api::V1::UsersCollection.as_json
render json: Api::V1::UsersCollection.as_json
end
def show
@user = User.find(params[:id])
@steam = SteamCondenser::Community::SteamId.from_steam_id("STEAM_#{@user.steamid}")
render json: {
steam: {
url: @steam.base_url,
nickname: @steam.nickname
}
}
end
end