Added full documentation website into server.js
This commit is contained in:
BIN
Updated Code.zip
Normal file
BIN
Updated Code.zip
Normal file
Binary file not shown.
@@ -71,15 +71,26 @@ paths:
|
|||||||
- Ideas
|
- Ideas
|
||||||
security:
|
security:
|
||||||
- BearerAuth: []
|
- BearerAuth: []
|
||||||
|
parameters:
|
||||||
|
- $ref: '#/components/parameters/SearchQuery'
|
||||||
|
- $ref: '#/components/parameters/SortBy'
|
||||||
|
- $ref: '#/components/parameters/Limit'
|
||||||
|
- $ref: '#/components/parameters/Offset'
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: OK
|
description: OK
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: object
|
||||||
items:
|
properties:
|
||||||
$ref: '#/components/schemas/Idea'
|
data:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/Idea'
|
||||||
|
total:
|
||||||
|
type: integer
|
||||||
|
example: 100
|
||||||
'401':
|
'401':
|
||||||
description: Unauthorized - Missing or invalid token
|
description: Unauthorized - Missing or invalid token
|
||||||
post:
|
post:
|
||||||
@@ -584,10 +595,10 @@ components:
|
|||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
example: A task Manager
|
example: Updated Task Manager
|
||||||
description:
|
description:
|
||||||
type: string
|
type: string
|
||||||
example: A web app that manages tasks.
|
example: Updated Description for the task mananger idea.
|
||||||
|
|
||||||
Project:
|
Project:
|
||||||
type: object
|
type: object
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const PORT = process.env.PORT || 3000;
|
|||||||
|
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.get('/health', (req, res) => res.status(200).json({ status: 'UP' }));
|
app.get('/health', (req, res) => res.status(200).json({ status: 'UP' }));
|
||||||
app.get('/', (req, res) => res.status(200).send('API is running...\nVisit /api-docs for API documentation'));
|
app.get('/', (req, res) => res.status(200).send('API is running...\nVisit https://idea-tracker-api.onrender.com/api-docs for API documentation'));
|
||||||
if (process.env.NODE_ENV !== 'test') app.use(morgan('tiny'));
|
if (process.env.NODE_ENV !== 'test') app.use(morgan('tiny'));
|
||||||
|
|
||||||
let specs;
|
let specs;
|
||||||
|
|||||||
Reference in New Issue
Block a user