-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
76 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
## Developer Certificate of Origin and License | ||
|
||
By contributing to GitLab B.V., you accept and agree to the following terms and | ||
conditions for your present and future contributions submitted to GitLab B.V. | ||
Except for the license granted herein to GitLab B.V. and recipients of software | ||
distributed by GitLab B.V., you reserve all right, title, and interest in and to | ||
your Contributions. | ||
|
||
All contributions are subject to the Developer Certificate of Origin and license set out at [docs.gitlab.com/ce/legal/developer_certificate_of_origin](https://docs.gitlab.com/ce/legal/developer_certificate_of_origin). | ||
|
||
_This notice should stay as the first item in the CONTRIBUTING.md file._ | ||
|
||
## Code of conduct | ||
|
||
As contributors and maintainers of this project, we pledge to respect all people | ||
|
@@ -34,7 +22,7 @@ This code of conduct applies both within project spaces and in public spaces | |
when an individual is representing the project or its community. | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior can be | ||
reported by emailing [email protected]. | ||
reported by shouting into the void. | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org), version 1.1.0, | ||
available at [https://contributor-covenant.org/version/1/1/0/](https://contributor-covenant.org/version/1/1/0/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,83 @@ | ||
# Node Express template project | ||
# MusicBox API | ||
|
||
This project is based on a GitLab [Project Template](https://docs.gitlab.com/ee/user/project/#create-a-project-from-a-built-in-template). | ||
This project provides an interface to the MusicBox database. See #randommusic on Rizon IRC. | ||
|
||
Improvements can be proposed in the [original project](https://gitlab.com/gitlab-org/project-templates/express). | ||
## Features | ||
|
||
## CI/CD with Auto DevOps | ||
- Provides endpoints to query data from the music database. | ||
- Secure and scalable API built with Node.js and Express. | ||
|
||
This template is compatible with [Auto DevOps](https://docs.gitlab.com/ee/topics/autodevops/). | ||
## Getting Started | ||
|
||
If Auto DevOps is not already enabled for this project, you can [turn it on](https://docs.gitlab.com/ee/topics/autodevops/#enable-or-disable-auto-devops) in the project settings. | ||
### Prerequisites | ||
|
||
### Developing with Gitpod | ||
- Node.js (v14.0.0 or higher) | ||
- npm (Node Package Manager) | ||
- mysql or mariadb | ||
|
||
This template has a fully-automated dev setup for [Gitpod](https://docs.gitlab.com/ee/integration/gitpod.html). | ||
### Installation | ||
|
||
If you open this project in Gitpod, you'll get all Node dependencies pre-installed. | ||
1. **Clone the Repository** | ||
|
||
```bash | ||
git clone <repository-url> | ||
cd <project-directory> | ||
``` | ||
|
||
2. **Install Dependencies** | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
3. **Configure Database Settings** | ||
|
||
- Copy the example configuration file to `config.js`. | ||
|
||
```bash | ||
cp config.js.example config.js | ||
``` | ||
|
||
- Edit `config.js` and fill in your database connection parameters. | ||
|
||
|
||
```javascript | ||
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; | ||
``` | ||
|
||
### Running the Application | ||
|
||
- Start the application using npm. | ||
|
||
```bash | ||
npm start | ||
``` | ||
|
||
- The API will be running on `http://localhost:3000`. | ||
|
||
## Endpoints | ||
|
||
- **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](docs/api.md). | ||
|
||
## Contributing | ||
|
||
Contributions are welcome! Please read our [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute to this project. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |