To run this project in the development mode, you'll need to have a basic environment with NodeJS 13+ installed. To use the database, you'll need to have MongoDB installed and running on your machine at the default port (27017).
Cloning the Repository
$ git clone https://github.com/devclub-iitd/CommonAudioVideoServer.git
$ cd CommonAudioVideoServer
Installing dependencies
$ npm install
Starting The Server In Development Node
$ npm run watch-debug
The base URL is: http://localhost:5000/api/
- This is the route that you can use to check if the API is running properly.
ENDPOINT | Method | Params | URL Params | Success Response | Error Response |
---|---|---|---|---|---|
/ | GET |
- | - | Code: 200 - OK Content: { message: "Hooray! Welcome to Common Audio Server!",data: null } |
Code: 500 - INTERNAL SERVER ERROR Content: { error: <A Message with a description of the Error> } |
- Upload a Track
For this request, you'll need to send the .mp3 file and all the Track data. If you don't know how to send a file using a http client tool, here's an example of how to do it with Postman.
ENDPOINT | Method | Params | URL Params | Success Response | Error Response |
---|---|---|---|---|---|
/upload | POST |
- | - | Code: 200 - OK Content: { track: Track } |
Code: 500 - INTERNAL SERVER ERROR Content: { error: <A Message with a description of the Error> } |
- NodeJS - Build the server
- body-Parser - Node.js body parsing middleware
- express - Router of the Application
- MongoDB - Database
- mongoose - Object Modeling + DB Connector
- nodemon - Process Manager used in the development
- dotenv - Environment loader
- multer - File Upload
- gridFS-Stream - Store and stream data from Database
- gts - TS Linter and code style
- prettier - Code formatter