Skip to content

Instantly share code, notes, and snippets.

@jhonnrodr
Created August 20, 2014 17:05
Show Gist options
  • Save jhonnrodr/697af45758df61164b11 to your computer and use it in GitHub Desktop.
Save jhonnrodr/697af45758df61164b11 to your computer and use it in GitHub Desktop.
Default App.js Node
var express = require('express');
var app = express();
app.set('view engine', 'ejs');
app.use(express.bodyParser());
app.get("/", function(req, res){
res.send("<form action='/envio' method='post'> Nombre: <input type='text' name='name' /> <input type='submit' value'send' /></form> ");
});
app.post("/envio", function(req, res){
var nombre = req.body.name;
res.send(200, nombre);
});
app.listen(5000, function(){
console.log("Listen in Localhost:5000");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment