bizley / timeclock

Simple work time clocking service
MIT License
30 stars 11 forks source link

Added an additional controller #4

Closed hunwalk closed 5 years ago

hunwalk commented 5 years ago

Hi, so I've decided to make an Android app for timeclock, but i need a testpoint so i can check wether the api is online and will provide me the correct json schema. This is just a prototype, you can discard it and make another solution if you like.

bizley commented 5 years ago

I'm not sure why you need additional controller for such a test. Why not use key endpoint for example? You will know that API is online by calling all other endpoints without authenticating header - error pops up ;) And for the correct schema - this is a matter of proper code so it should be tested before.

So I'm closing this PR but I'm open for discussion if you want :)

hunwalk commented 5 years ago

Well...makes sense 👍 but my redux store looks like this:

screenshot 2019-01-20 at 11 58 46

And this is not very elegant. Now I'm checking timeclock server like, "Oh there is a pin code error, hey there server, nice to see you" This could be good enough, tough this is a failed request in my code 😛

bizley commented 5 years ago

Hmm, ok, what about calling api/key without any verbs to get OPTIONS? You should get in return empty body with status 200.