This commit is contained in:
Martin Donnelly 2019-12-11 00:21:59 +00:00
parent 9e2c07ba38
commit b9b061ba19

View File

@ -40,14 +40,10 @@ app.post('/auth', function(request, response) {
const username = request.body.u;
const password = request.body.p;
console.log(username, password);
if (username && password)
db.getOne(username, password)
.then((data) => {
console.log('data', data);
if (!data)
response.send('Incorrect Username and/or Password!');
@ -65,9 +61,9 @@ app.post('/auth', function(request, response) {
});
else {
response.send('Please enter Username and Password!');
response.end();
}
response.send('Please enter Username and Password!');
response.end();
}
});
require('./server/routes/recipe.routes')(app);
@ -75,5 +71,5 @@ require('./server/routes/view.routes')(app);
// listen for requests
app.listen(serverPort, () => {
console.log('Server is listening on port 3000');
console.log(`Server is listening on port ${serverPort}`);
});