I am creating a Dapp and i have put this code in visual:
<!-- Moralis SDK code -->
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<script src="https://unpkg.com/moralis/dist/moralis.js"></script>
<h1>Gas Stats With Moralis</h1>
<button id="btn-login">Moralis Login</button>
<button id="btn-logout">Logout</button>
<script>
// connect to Moralis server
const serverUrl = "https://giailjch79uo.usemoralis.com:2053/server";
const appId = "c2ztbZHPZN1gFpG1Xyt8wFxGRmCv3Flwtaqsbicn";
Moralis.start({ serverUrl, appId });
// add from here down
async function login() {
let user = Moralis.User.current();
if (!user) {
user = await Moralis.authenticate();
}
console.log("logged in user:", user);
}
async function logOut() {
await Moralis.User.logOut();
console.log("logged out");
}
document.getElementById(“btn-login”).onclick = login;
document.getElementById(“btn-logout”).onclick = logOut;
</script>
But when i open the file in the server and I click in Moralis login Metamask does not appear