Skip to content

Commit 328ec01

Browse files
committed
change README.md
1 parent 0fa58a1 commit 328ec01

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ A proxy server to access Salesforce API from JSforce JavaScript apps served outs
55
As the same origin policy restricts communication to the Salesforce API from outer domain,
66
you should serve cross-domain proxy server when you build a app using JSforce outside of Salesforce.
77

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.
109

1110
## Usage
1211

@@ -40,11 +39,20 @@ conn.query('SELECT Id, Name FROM Account', function(err, res) {
4039

4140
## Using as Middleware
4241

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:
4452

4553
```javascript
4654
var express = require('express');
47-
var jsforceAjaxProxy = require('./proxy');
55+
var jsforceAjaxProxy = require('jsforce-ajax-proxy');
4856
var app = express();
4957

5058
app.all('/proxy/?*', jsforceAjaxProxy());
@@ -61,3 +69,4 @@ app.all('/proxy/?*', jsforceAjaxProxy({ enableCORS: true });
6169
6270
You don't have to use this app when you are building a JSforce app in Visualforce,
6371
because it works in the same domain as Salesforce API.
72+

0 commit comments

Comments
 (0)