This project provides an interface to the MusicBox database. See #randommusic on Rizon IRC.
- Provides endpoints to query data from the music database.
- Secure and scalable API built with Node.js and Express.
- Node.js (v14.0.0 or higher)
- npm (Node Package Manager)
- mysql or mariadb
-
Clone the Repository
git clone <repository-url> cd <project-directory>
-
Install Dependencies
npm install
-
Install Database
mysql -uyour-database-user -p your-database-name < db.sql
-
Configure Database Settings
-
Copy the example configuration file to
config.js
.cp config.js.example config.js
-
Edit
config.js
and fill in your database connection parameters.const config = { db: { host: "your-database-host", user: "your-database-user", password: "your-database-password", database: "your-database-name", connectTimeout: 60000 }, listPerPage: 10000, }; module.exports = config;
-
-
Start the application using npm.
npm start
-
The API will be running on
http://localhost:5000
.
- GET /api/users: Retrieve a list of users.
- GET /api/videos?userid=1: Retrieve a list of videos/tracks posted by userid 1. RIP Cuckoo <3
- GET /api/leaderboard: Retrieve a list of users ranked by how many posts.
For more detailed endpoint information, make up some API Documentation.
Contributions are welcome! Please read our CONTRIBUTING.md for guidelines on how to contribute to this project.
This project is licensed under the MIT License - see the LICENSE file for details.