express-serve-static-core: Fix examples for send, json and jsonp (#33801)

This commit is contained in:
SnakeDrak
2019-03-18 17:05:41 +01:00
committed by Wesley Wigham
parent efce85a06e
commit 4d4a2996c0

View File

@@ -507,8 +507,7 @@ export interface Response extends http.ServerResponse, Express.Response {
* res.send(new Buffer('wahoo'));
* res.send({ some: 'json' });
* res.send('<p>some html</p>');
* res.send(404, 'Sorry, cant find that');
* res.send(404);
* res.status(404).send('Sorry, cant find that');
*/
send: Send;
@@ -519,8 +518,8 @@ export interface Response extends http.ServerResponse, Express.Response {
*
* res.json(null);
* res.json({ user: 'tj' });
* res.json(500, 'oh noes!');
* res.json(404, 'I dont have that');
* res.status(500).json('oh noes!');
* res.status(404).json('I dont have that');
*/
json: Send;
@@ -531,8 +530,8 @@ export interface Response extends http.ServerResponse, Express.Response {
*
* res.jsonp(null);
* res.jsonp({ user: 'tj' });
* res.jsonp(500, 'oh noes!');
* res.jsonp(404, 'I dont have that');
* res.status(500).jsonp('oh noes!');
* res.status(404).jsonp('I dont have that');
*/
jsonp: Send;