public/javascript/logout.js
// call function to logout of page
call function to logout of page
call function to logout of page
function logout() {
    fetch("/api/user/logout", {
        method: "post",
        headers: { "Content-Type": "application/json" }
    })
        .then(function () {
            document.location.replace("/");
        })
        .catch(err => console.log(err));
}
function logout ( ) { fetch ( "/api/user/logout" , { method : "post" , headers : { "Content-Type" : "application/json" } } ) . then ( function ( ) { document . location . replace ( "/" ) ; } ) . catch ( err => console . log ( err ) ) ; }
call function to logout of page
call function to logout of page