Created
August 20, 2014 17:05
-
-
Save jhonnrodr/697af45758df61164b11 to your computer and use it in GitHub Desktop.
Default App.js Node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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