Heartbeat API with device token authentication

This commit is contained in:
leenasn
2015-11-09 16:19:50 +05:30
parent b51d535cfe
commit 7a2e2c15d2
5 changed files with 51 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
class HeartbeatsController < ApplicationController
before_action :authenticate_device
respond_to :json
def create
heartbeat = Heartbeat.create(device: @device)
render json: { next_heartbeat_time: heartbeat.next_heartbeat_time },
status: :created
end
end