This is the API for an audio stream platfrom.
To install and run the metamusic-back API locally, follow these steps:
- Clone the repository:
git clone https://github.com/Vastem/metamusic-back.git
- Navigate to the project directory:
cd metamusic-back
- Navigate to the project directory:
npm install
-
Configure the environment variables by creating a .env file and providing the necessary values. You can use the .env.example file as a template.
-
Start the API server:
node app.js
- The API will be available at
http://localhost:3000.
- Express
- Node.js
- JWT
- MongoDB
The metamusic-back provides the following endpoints:
-
POST /admin: Creates a new admin. -
POST /admin/login: Logs in an admin and generates a token. -
GET /admin: Retrieves all admins. -
GET /admin/:id: Retrieves admins by ID. -
PUT /admin/:id: Updates admin information by ID. -
DELETE /admin/:id: Delete admins by ID. -
POST /user: Creates a new user. -
POST /user/login: Logs in a user and generates a token. -
GET /user: Retrieves all users. -
GET /user/:id: Retrieves user by ID. -
PUT /user/:id: Updates user information by ID. -
DELETE /user/:id: Delete users by ID. -
POST /user/subscribe: Subscribe a user for a period of time and generate a token -
POST /song: Creates a new song. -
GET /song: Retrieves all songs. -
GET /song/:id: Retrieves songs by ID. -
PUT /song/:id: Updates song information by ID. -
DELETE /song/:id: Delete songs by ID. -
GET /song/search/byname/:name: Retrieves songs by name. -
GET /song/search/byalbum/:album: Retrieves songs by album. -
GET /song/search/bysingers/:singers: Retrieves songs by singers. -
POST /playlist: Creates a new playlist. -
GET /playlist: Retrieves all playlists. -
GET /playlist/:id: Retrieves playlists by ID. -
PUT /playlist/:id: Updates playlist information by ID. -
DELETE /playlist/:id: Delete playlists by ID. -
GET /playlist/search/byname/:name: Retrieves playlists by name. -
PUT /playlist/addsong/:idplaylist: Add songs to playlist. -
PUT /playlist/removesong: Remove songs from playlist. -
POST /suscription: Creates a new suscription. -
GET /suscription: Retrieves all suscriptions. -
GET /suscription/:id: Retrieves suscriptions by ID. -
PUT /suscription/:id: Updates suscription information by ID. -
DELETE /suscription/:id: Delete suscriptions by ID.
This project is licensed under the MIT License.
