Skip to content

Instantly share code, notes, and snippets.

Created March 11, 2014 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9495481 to your computer and use it in GitHub Desktop.
Save anonymous/9495481 to your computer and use it in GitHub Desktop.
function listen(){
app.use(express.bodyParser());
app.post('/login', function(req, res) {
var username = req.body.username;
var password = req.body.password;
console.log('User ' + username + ' is attempting login...');
validator.validate(username,password,function(err,result){
if (err) loginFail(req,res,err);
else loginSucceed(req,res,result);
});
});
app.listen(8080, function() {
console.log('Server running at http://127.0.0.1:8080/');
});
}
exports.listen = listen;
console.log('server module initialized');
var express = require('express');
var login = require("./login");
var app = express();
login.listen();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment