Comments (7)
Thank you very much, very helpful!
Have a nice day Andrew!
from sp-rest-proxy.
Cheers! Any questions about sp-request
and node-sp-auth
are welcomed.
from sp-rest-proxy.
Hi Bruce,
Could you please elaborate your use case scenario?
We usually run a proxy in serve mode along or independently from the project, point the requests to the proxy's URL during the development cycle. This lets boosting with processes of SPA development without publishing anything to SharePoint or referencing to localhost'ed assets.
In such scenario, any http library (Axios, Fetch, jQuery.ajax, xhr, $http, etc.) can consume the service (with cross-domain origin requests nuances in mind). And one could not think about SharePoint auth related staff, just business logic.
After the development cycle, the code is published for hosting and living inside SharePoint pages context. The requests are routed to _spPageContextInfo.
Also, sp-rest-proxy can be integrated to the end project with settings pointing to your front-end files (settings.staticRoot).
--
Andrew
from sp-rest-proxy.
My first use case is to get data from a Sharepoint list into a nodejs microservices server to be used in a REST client (reactjs).
Later on, I would add CRUD operations.
from sp-rest-proxy.
So your project is a microservice API and it attends to run in NodeJS environment in production? Not only while the development stage?
If so, there is a nice way to deal with such case with the use of sp-request, which, btw, is also used in sp-rest-proxy.
Where is your React client-app living? Outside SharePoint?
Is the microservice in charge of users authentication too?
from sp-rest-proxy.
yes, development and production.
I will have a look at sp-request, for what I read it seems to handle authentication and modern javascript too!
The ReactJs / React-Native apps will be used outside Sharepoint, I create those microservices to create a json cache for SP lists because I will do server-side rendering and/or store the json files in the apps.
It's to store towns' road names, which don't get updated that often...
For the Update part, which is later, I would need to authenticate the users... but I'm not there yet
from sp-rest-proxy.
Got it!
Yep, I would recommend using sp-request
and wrapping requests to SharePoint in your NodeJS API.
This allows you to separate API access to the specific operations.
sp-rest-proxy
abstracts access layer to SharePoint. And any request to SharePoint tenant executes under provided service account. It's wonderful when the proxy extends development toolchain, but a not what is expected from a secure microservice in production. The idea behind the proxy is for slightly different things (dev toolchain, CI).
from sp-rest-proxy.
Related Issues (20)
- Identical requests - succeeding and failing HOT 4
- Can this react app be deployed as a web app on to a windows server so that users can access the app outside of the server ? HOT 6
- Host "sp-rest-proxy" as an independent web-app on Azure or pass authentication in configs to be used in CI/CD pipeline HOT 1
- Can this proxy be used when the host SP environment (on prem) has a "strict-origin-when-cross-origin" HTTP referrer policy? HOT 3
- sharepoint MFA bypass HOT 2
- [Feature query] Can the proxy be made to connect to multiple sites? HOT 1
- sp-rest-proxy with sharepointplus HOT 10
- POST request fails when calling the proxy (adding extra path to sharepoint request) HOT 5
- Proxy Error: Cannot read properties of null (reading 'toString') (see more in sp-rest-proxy console) HOT 4
- Version 3.3.4 broken for OnpremiseUserCredentials HOT 5
- Cannot read properties of null (reading 'toString') HOT 3
- On Demand - cannot read properties of null / childprocess.spawnsync EONENT Error HOT 2
- Proxy approach for Azure Active Directory HOT 2
- Typescript import HOT 1
- Setting siteUrl programatically HOT 4
- sp-rest-proxy does not work with Node 18.16.0 (current LTS) HOT 5
- Thank you HOT 1
- Docker HOT 2
- JSOM using sp-rest-proxy / clarification needed HOT 9
- 401 When Running in Docker HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sp-rest-proxy.