REST via Photon Server

Hello, mates!
I need some help with REST requests handling. Im trying to use AddRestRequestHandler to create some kind of health check controller, but getting "not found" when im sending request.
Should i use specific listener config or it's wrong path format or something else?
Here is my multiple handler registration attempts and current listener config
Best Answer
-
@Norfin yes, it might be that it does not work. A lot of changed since it was started.
Because we did not test it quite long. and one think that was not implemented still, is that you are not able to send error back. only success.
so, I would recommend to use OWIN or something like that.
if you what our handlers working try next thing
AddRestRequestHandler("healthcheck", ...);
Listener config
<HTTPListener Name="*:[PORT]::YourAppName" IPAddress="0.0.0.0" Port="80" DisableNagle="true" InactivityTimeout="35000" > <Routing> <Route Url="/api/*" PeerType="HTTP" Counters="true" OverrideApplication="YourAppName"/> </Routing> </HTTPListener>
so, than it should work like http://address/api/healtcheck
keep me updated about your results
best,
ilya
0
Answers
-
hi, Ilya
does it mean AddRestRequestHandler is not working?
thats sad if its true
but how can i use middleware, if i can't get acces directly to requests due all proceesing is inside ApplicationBase
0 -
@Norfin yes, it might be that it does not work. A lot of changed since it was started.
Because we did not test it quite long. and one think that was not implemented still, is that you are not able to send error back. only success.
so, I would recommend to use OWIN or something like that.
if you what our handlers working try next thing
AddRestRequestHandler("healthcheck", ...);
Listener config
<HTTPListener Name="*:[PORT]::YourAppName" IPAddress="0.0.0.0" Port="80" DisableNagle="true" InactivityTimeout="35000" > <Routing> <Route Url="/api/*" PeerType="HTTP" Counters="true" OverrideApplication="YourAppName"/> </Routing> </HTTPListener>
so, than it should work like http://address/api/healtcheck
keep me updated about your results
best,
ilya
0 -
Its working! Thank you so much!
0 -
But im still interested in using OWIN or some other middleware, but still dont understand how, if all requests are processing by ApplicationBase
0