user3655266 user3655266 - 1 month ago 7
HTTP Question

How to handle incoming http requests on loopback

I am using loopback and building a login page. The client side files have the login page
$(document).ready(function(){

$('#login').click(function(){

var username = $('#usr').val();
var password = $('#pwd').val();

$.get("http://server,{
user_type:1,
username:username,
password:password
},function(data,status,xhr){
console.log("Request was "+status);
console.log("Result : "+data.login_type);
console.log("UserId : "+data.user_id);


if(dat.login_type == 'success'){
// Redirect to other server
}
});

});


})

this is hosted on localhost:3000, when a http request is made to this server , how can i get the incoming request object?

Answer

Here you have description how to add a static web page and here how add a simple Express routing

Comments