signalpoint / jDrupal

A JavaScript Library and API for Drupal Applications
http://jdrupal.tylerfrankenstein.com/
GNU General Public License v2.0
76 stars 38 forks source link

Any support for custom endpoints? #48

Open anakinjay opened 7 years ago

anakinjay commented 7 years ago

Just curious, I have a few custom routes in my D8 module that return Json data that only work for logged in users. The endpoint has to combine drupal data with data from an external source so just using drupal's rest api and a view wouldn't work.

Is there any way to piggyback on the jDrupal object to have it make an authenticated request to that custom endpoint?

signalpoint commented 7 years ago

@anakinjay I haven't tried it yet, but it's definitely possible. Essentially just copy one of jDrupal's .js implementations of a resource, and change it to use your resource.

anakinjay commented 7 years ago

awesome, I'll give it a whirl. Thanks!