سؤال

We want to read and update SP2013 list data from our purely client-side javascript create-react-app project. Our production build files (html and js) can be hosted in the same domain on SharePoint (perhaps in the SiteAssets library), but the issue is our dev server will run from localhost. What is the best way to access list data from our dev server which will not be on the same domain?

I found a guide here that suggested using an IFrame point to an aspx page on SharePoint that can then use PostMessage to push the data back to our app. Not sure if this is the best way. Unfortunately we can't do anything server side or use c#.

هل كانت مفيدة؟

المحلول

This solution worked perfectly: https://www.linkedin.com/pulse/getting-started-react-local-development-sharepoint-andrew-koltyakov/ . It sets up a node proxy server that is authenticated using node-sp-auth-config and can call the api cross domain.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top