1
0
mirror of https://github.com/arduino-libraries/ArduinoHttpClient.git synced 2025-04-19 21:22:15 +03:00

Make whitespace consistent in getPostPutDelete.js

This commit is contained in:
Sandeep Mistry 2016-06-28 16:49:15 -04:00
parent 6c39432271
commit 829cb2d1f7

View File

@ -8,7 +8,7 @@
*/ */
var express = require('express'); // include express.js var express = require('express'); // include express.js
var app = express(); // a local instance of it var app = express(); // a local instance of it
var bodyParser = require('body-parser'); // include body-parser var bodyParser = require('body-parser'); // include body-parser
// you need a body parser: // you need a body parser:
@ -16,8 +16,8 @@ app.use(bodyParser.urlencoded({extended: false})); // for application/x-www-form
// this runs after the server successfully starts: // this runs after the server successfully starts:
function serverStart() { function serverStart() {
var port = server.address().port; var port = server.address().port;
console.log('Server listening on port '+ port); console.log('Server listening on port '+ port);
} }
// this is the POST handler: // this is the POST handler:
@ -26,12 +26,12 @@ app.all('/*', function (request, response) {
// the parameters of a GET request are passed in // the parameters of a GET request are passed in
// request.body. Pass that to formatResponse() // request.body. Pass that to formatResponse()
// for formatting: // for formatting:
console.log(request.headers); console.log(request.headers);
if (request.method == 'GET') { if (request.method == 'GET') {
console.log(request.query); console.log(request.query);
} else { } else {
console.log(request.body); console.log(request.body);
} }
// send the response: // send the response:
response.send('OK'); response.send('OK');