If If all you need is to return the ArcServer Service as a GeoJSON to use in whichever mapping tech you want, I highlyhighly recommend you look at this GitHub issue dialogue.
I am not going to replicate the dialogue here because that would waste time. Your options are clearly laid out there directly from Esri.