I'm trying to use a form to submit to the website so that I can render the website.
this is my form
div.ten.columns#LogModal
h3 Log In
p
a.button(href='#', data-reveal-id='exampleModal') Example modal
div#exampleModal.reveal-modal
h2 Log In
p
form(method='get', action='/Log')
input(type='text', placeholder='Username', name='Username', id='Username')
input(type='password', placeholder='Password', name='Password', id='Username')
input(type='submit', value='Log in', id='LogButton')
script(src='javascripts/foundation.min.js')
script(src='javascripts/app.js')
script
$(window).load(function(){
$("#featured").orbit();
});
And its just going through the server.js like so
app.get('/Log', User.Home);
and eventually renders a webpage like so:
exports.Home = function (req, res) {
res.render('MyHome'); };
and all that results in this error:
Cannot GET /Log?Username=&Password=&LogButton=Log+in
I want it to work without any log in information at this point because its just for demonstration right now. Can anybody help me?
app.get('/Log', User.Home);
In this function, if User.Home is not defined then you will get this error. Does Home function exist in User model?
Just create one function(lets say 'demoHome') with any name in server.js and call it here like..
app.get('/Log', demoHome);
where demoHome function will be defined as..
var demoHome = function(req, res){ somecode here with proper response or render any page here using res.rendere('path/of/template')};