Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow more granular control over JSONP #1241

Closed
wants to merge 5 commits into from

4 participants

@daguej

Proposed changes for #1240. This adds an options argument to Response.json():

res.json([status,] object[, options]);

Options are:

{
    jsonp: Boolean, // enable or disable JSONP output for this response
    jsonpCallbackName: String, // query string parameter to use for callback name
    jsonReplacer: Function || Array, // the replacer to send to JSON.stringify
    jsonSpaces: Boolean // tell JSON.stringify to pretty print
}

Each of these options overrides the corresponding global option. If any option is omitted, we fall back to the global setting.

lennym and others added some commits
@lennym lennym Made quotes consistent
One-off use of double quotes aggravated my OCD.
8211562
@tj tj Merge pull request #1540 from fern4lvarez/master
Use End-of-line Node constant
b4f6124
@tj tj Merge pull request #1534 from lennym/patch-1
Made quotes consistent in generated app.js
158f452
@daguej daguej Merge branch 'master' of github.com:daguej/express
Conflicts:
	lib/response.js
8feb479
@jonathanong

a little out of date. there's now res.jsonp().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 22, 2012
  1. @daguej
Commits on Mar 7, 2013
  1. @lennym

    Made quotes consistent

    lennym authored
    One-off use of double quotes aggravated my OCD.
Commits on Mar 13, 2013
  1. @tj

    Merge pull request #1540 from fern4lvarez/master

    tj authored
    Use End-of-line Node constant
  2. @tj

    Merge pull request #1534 from lennym/patch-1

    tj authored
    Made quotes consistent in generated app.js
Commits on Apr 1, 2013
  1. @daguej

    Merge branch 'master' of github.com:daguej/express

    daguej authored
    Conflicts:
    	lib/response.js
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  bin/express
View
2  bin/express
@@ -236,7 +236,7 @@ var app = [
, 'app.get(\'/users\', user.list);'
, ''
, 'http.createServer(app).listen(app.get(\'port\'), function(){'
- , ' console.log("Express server listening on port " + app.get(\'port\'));'
+ , ' console.log(\'Express server listening on port \' + app.get(\'port\'));'
, '});'
, ''
].join(eol);
Something went wrong with that request. Please try again.