let CONTEXT_PATH = "/nlib";

function login(){
    const username = document.getElementById('username').value;
    const password = document.getElementById('password').value;
    let userInfo = {};

    userInfo.username = username;
    userInfo.password = password;
    
    alert("going to send");

    $.ajax({
        type: "post",
        /* url: "/login",*/
        url: CONTEXT_PATH + "/login/login.do",
        data: userInfo,
        success: function(data) {
            alert('성공');
            console.log(data);
            //location.href="/"
        },
        error: function(e){
            alert('error!!');
        }
    });
}