I have a pretty good understanding of how to use the app.get function, but I'm having trouble with the app.post.
In the following app.js code, should the /someurl be the same as in the action='/acturl' of my form?
app.js
app.post('/someurl', function(req, res) {
var name = req.body.name,
pass = req.body.pass;
//save name, pass to db
});
form.jade
form.form-signin(method='post',action='/acturl')
h2.form-signin-heading Please sign in
input.input-block-level(type='text', name='name', placeholder='Username')
input.input-block-level(type='password',name='pass', placeholder='Password')
button.btn.btn-large.btn-primary(type='submit') Sign in
allways (yes) --> should the /someurl be the same as in the action='/acturl' of my form?
how can I save the req.body.postvars to a mongo database?
Take a look ta some plugin like http://mongoosejs.com/ (is just an example) for mongodb object modeling.
Hope it helps