You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,7 @@ A proxy server to access Salesforce API from JSforce JavaScript apps served outs
5
5
As the same origin policy restricts communication to the Salesforce API from outer domain,
6
6
you should serve cross-domain proxy server when you build a app using JSforce outside of Salesforce.
7
7
8
-
This app will become obsolete immediately when Salesforce API supports CORS.
9
-
I hope the day will come soon.
8
+
As Salesforce REST API supports CORS (Cross-Origin Resource Sharing) access, this proxy is not always required when you are using only REST API and you can change security setting in your connecting organization. This proxy is still useful because you can access not only REST APIs but also SOAP-based APIs from outer domain.
10
9
11
10
## Usage
12
11
@@ -40,11 +39,20 @@ conn.query('SELECT Id, Name FROM Account', function(err, res) {
40
39
41
40
## Using as Middleware
42
41
43
-
Ajax proxy works as connect middleware. For example you can include the proxy functionality in your express.js app :
42
+
Ajax proxy is not only provided in standalone server but also works as connect middleware.
43
+
You can include the proxy functionality in your express.js app.
44
+
45
+
First install `jsforce-ajax-proxy` in your app project:
46
+
47
+
```
48
+
$ npm install jsforce-ajax-proxy --save
49
+
```
50
+
51
+
Then include the middleware under certain path:
44
52
45
53
```javascript
46
54
var express =require('express');
47
-
var jsforceAjaxProxy =require('./proxy');
55
+
var jsforceAjaxProxy =require('jsforce-ajax-proxy');
0 commit comments