create old api method for ir daemon to start race from (This should be removed and moved to dedicated daemon/service.

This commit is contained in:
chris.watts90@outlook.com 2018-02-28 19:34:09 +00:00
parent 45bb793cc9
commit aebf90259b

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http.Results;
using Interfaces;
using Nancy;
namespace RaceLapTimer.ApiControllers
{
class OldRaceSessionApiModule : NancyModule
{
private INotifierManager _manager;
public OldRaceSessionApiModule(INotifierManager notifierManager)
:base("/api/v1/race_session")
{
_manager = notifierManager;
Post["new"] = args => CreateNewRace();
}
private dynamic CreateNewRace()
{
//TODO: what goes here?
_manager.NotifyRaceStarted(new NotificationEventArgs());
return HttpStatusCode.OK;
}
}
}