
Template details
Simple Discord Bot Website
An open-source Express.js website and API for Discord bots, showing live status, server count, and ping on a self-hosted homepage.
About this template
Simple Discord Bot Website is an open-source Express.js website template that gives Discord bots a public homepage and a REST API for reporting live stats like server count and ping. Built by JLDENSMORE and maintained as a GitHub repository, it pairs a minimal HTML/CSS/JavaScript front end with a Node.js backend that exposes JSON endpoints for bot status.
What is Simple Discord Bot Website?
Simple Discord Bot Website is a Node.js project that combines a Discord bot landing page with a small backend API. It takes configuration from environment variables — port, support server invite, bot invite link, and the URL of the bot's own server — and produces a website that automatically displays whether the bot is online, how many servers it serves, and its ping. The project runs on Express.js and requires Node.js version 18 or newer, with npm or yarn for dependency management.
What makes it stand out?
- Modern Express.js backend — Uses Express with built-in JSON parsing, removing the deprecated body-parser package, and native fetch instead of node-fetch.
- Security middleware — Helmet sets secure HTTP headers, and Express-rate-limit throttles requests to prevent abuse.
- Environment variable configuration — Reads PORT, NODE_ENV, SUPPORT_SERVER, BOT_INVITE, and BOT_SERVER from a .env file, with config.json as a fallback that is not recommended for production.
- RESTful API for bot stats — Endpoints include GET /api, GET /api/logo, GET /api/status, GET /api/stats, and POST /api/update-stats.
- Partial stat updates — POST /api/update-stats accepts just serverCount, just ping, or both, preserving the value not sent.
- Automatic online/offline detection — The website determines status by reaching the bot's server, and caches data if that server is temporarily unavailable.
- Cross-language examples — The README includes Discord.js and discord.py code for reporting stats, with cURL examples for each endpoint.
- Open source license — Released under the MIT License, so it can be freely modified and reused.
Who is it for?
- Discord bot developers who want a quick, self-hosted homepage for their bot without building a site from scratch.
- Developers using Discord.js in Node.js who want ready-made code to push server count and ping to the API.
- Developers using discord.py in Python who want equivalent aiohttp-based stat reporting.
- Open source contributors looking for a small Express.js project to improve; the repository invites pull requests.
What can you do with it?
- Show a live bot status page — Visitors see online/offline status, server count, and ping pulled from the configured bot server.
- Automate stat reporting — Discord.js and discord.py bots can POST their guild count and latency on a timer (the README suggests every 5 to 10 minutes).
- Customize bot branding — Set SUPPORT_SERVER and BOT_INVITE to point visitors to your Discord server and the bot's invite authorization link.
- Use it as an API learning example — The code demonstrates rate limiting, input validation, error handling, and environment-based configuration in Express.
How does it work?
The workflow starts by cloning the repository, running npm install, and copying .env.example to .env with your bot's support server, invite link, and bot server URL. After starting the server with npm start, the website automatically fetches stats from the bot server at BOT_SERVER, and the bot can also push stats by sending a POST request to /api/update-stats. The README shows the recommended cadence of updating every 5 to 10 minutes, since the site refreshes every 10 minutes.
Pricing
Simple Discord Bot Website is free and open source under the MIT License. There are no paid tiers or hosting requirements; you run it on your own Node.js environment.
FAQ
Is Simple Discord Bot Website free?
Yes, the project is released under the MIT License, so it is free to use, modify, and redistribute. You only need your own Node.js 18+ environment to run it.
What are the requirements to run it?
You need Node.js version 18.0.0 or newer and either npm or yarn. The project also expects a .env file (or config.json) with settings like PORT, SUPPORT_SERVER, BOT_INVITE, and BOT_SERVER before starting.
How does the bot update stats on the website?
The bot sends a POST request to /api/update-stats with a JSON body containing serverCount and/or ping. The repository includes Discord.js examples using fetch and discord.py examples using aiohttp to send these updates on an interval.
What API endpoints are available?
The main endpoints are GET /api (API info), GET /api/logo (bot avatar in various sizes), GET /api/status and GET /api/stats (bot status, server count, ping, and last update time), and POST /api/update-stats (accepts serverCount and ping fields).















