Skip to content

Instantly share code, notes, and snippets.

@leosilvadev
Created March 18, 2016 03:29
Show Gist options
  • Select an option

  • Save leosilvadev/f01c4b0070b9f566fc94 to your computer and use it in GitHub Desktop.

Select an option

Save leosilvadev/f01c4b0070b9f566fc94 to your computer and use it in GitHub Desktop.
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
//Aceitar requisições JSON (Content-Type: application/json)
app.use(bodyParser.json());
app.post('/usuarios', function(request, response){
console.log(request.body);//JSON recebido
response.json({mensagem:'Recebido!'});//Retornando JSON
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment