Skip to main content

Static Website

This tutorial walks through creating a custom static website with ZyveraWeb.

Step 1: Create Your Website

Create a folder for your site:

mkdir -p plugins/ZyveraWeb/site/my-site

Add your HTML, CSS, and JS files:

plugins/ZyveraWeb/site/my-site/index.html:

<!DOCTYPE html>
<html>
<head>
    <title>My Minecraft Server</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <h1>Welcome to My Server!</h1>
    <p>IP: play.myserver.com</p>
    <div id="players">Loading players...</div>
    <script src="script.js"></script>
</body>
</html>

plugins/ZyveraWeb/site/my-site/script.js:

fetch('/api/players')
    .then(r => r.text())
    .then(data => {
        const players = data.split(',').filter(Boolean);
        document.getElementById('players').textContent =
            'Online: ' + (players.join(', ') || 'None');
    });

Step 2: Configure the Site

Edit config.yml:

sites:
  - domain: "play.myserver.com"
    dir: "site/my-site"

If you don't have a domain, use the catch-all:

sites:
  - domain: ""
    dir: "site/my-site"

Step 3: Restart the Server

/zyveraweb server restart

Step 4: Access Your Site

  • With domain: http://play.myserver.com:8080
  • Without domain: http://<your-server-ip>:8080

Directory Structure

plugins/ZyveraWeb/site/my-site/
├── index.html
├── style.css
├── script.js
├── about.html
├── images/
│   └── logo.png
└── ...

Tips

  • Use the .html extension auto-append feature: /about serves about.html.
  • Subdirectories work naturally: /images/logo.png serves images/logo.png.
  • The default site can be replaced by deleting or renaming plugins/ZyveraWeb/site/default/ and creating your own.