description |
---|
Build Your First Moralis dApp! This Guide Series Covers the Basics and How to Get Started Fast. Part One Covers Server Setup. |
It goes so fast to build on Moralis. In this guide, we'll show you how easy it is to get a simple dApp up and running. Are you ready? Go...!
Go to Moralis and register a free account.
This will take a couple of minutes to spin up. While that's working, let's start coding!
In order to communicate with the Moralis Server, we need to include the Moralis code in our dApp. Open your favorite text editor. We recommend Visual Studio Code with the "Live Server" extension to make running the web page super easy.
Create a new file called index.html
and copy the following code.
<html>
<head>
<!-- Moralis SDK code -->
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<script src="https://unpkg.com/moralis-v1/dist/moralis.js"></script>
</head>
<body>
<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://xxxxx/server";
const appId = "YOUR_APP_ID";
Moralis.start({ serverUrl, appId });
</script>
</body>
</html>
Once the server instance has been created, find your Moralis server URL and application ID and paste them into the <script>
tag where indicated.
Your server is up and running. Keep going! Next up is part two where we learn how to log in with MetaMask.
{% content-ref url="build-a-simple-dap-in-3-mins-login-part-2.md" %} build-a-simple-dap-in-3-mins-login-part-2.md {% endcontent-ref %}