Something went wrong. Try again.
An all-in-one API for unified control and management over every facet of Inovus' digital ecosystem api.inovuslabs.org
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
const swaggerJSDoc = require('swagger-jsdoc');const swaggerUi = require('swagger-ui-express');
const options = { definition: { "openapi": '3.0.0', "info": { "title": "Inovus API", "description": "An all-in-one API for unified control and management over every facet of [Inovus Labs](https://inovuslabs.org/) digital ecosystem.", "version": "1.0.0", "contact": { "email": "mail@inovuslabs.org" }, "license": { "name": "MIT", "url": "https://opensource.org/licenses/MIT" } }, "servers": [ { "url": "http://localhost:3000", "description": "Development server" }, { "url": "https://api.inovuslabs.org", "description": "Production server" } ], "tags": [ { "name": "Auth", "description": "Authentication operations" } ], "schemes": [ "https", "http" ], "paths": {
"/auth/register": { "post": { "tags": [ "Auth" ], "summary": "Register a new user", "description": "Register a new user in the system.", "operationId": "registerUser", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "first_name": { "type": "string", "example": "John" }, "last_name": { "type": "string", "example": "Doe" }, "mobile": { "type": "string", "example": "9876543210" }, "email": { "type": "string", "example": "john@company.com" }, "dob": { "type": "string", "example": "1990-01-01" }, "gender": { "type": "string", "example": "male" }, "department": { "type": "string", "example": "Computer Science" }, "batch": { "type": "string", "example": "2015" }, "college": { "type": "string", "example": "Kristu Jyoti College of Management and Technology" }, "roles": { "type": "array", "example": ["General User"] }, "password": { "type": "string", "example": "Qwerty@123" }, "status": { "type": "string", "example": "inactive", }, }, } } }, "required": true }, "responses": { "200": { "description": "User created successfully" }, "400": { "description": "Error creating user" } } } },
"/auth/login": { "post": { "tags": [ "Auth" ], "summary": "Login a user", "description": "Login a user in the system.", "operationId": "loginUser", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string", "example": "john@company.com" }, "password": { "type": "string", "example": "Qwerty@123" } } } } }, "required": true }, "responses": { "200": { "description": "User logged in successfully" }, "401": { "description": "Error logging in user" }, "500": { "description": "Error logging in user" } } } }, },
}, apis: ['./routes/api/*.js'],};
const swaggerSpec = swaggerJSDoc(options);
module.exports = (app) => { app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec));};