b05f6b9da0
Jenkins Production Deployment
Co-authored-by: Patrick Müller <mail@pmueller.me> Reviewed-on: #7 Co-authored-by: Patrick Mueller <patrick@mueller-patrick.tech> Co-committed-by: Patrick Mueller <patrick@mueller-patrick.tech>
57 lines
1.9 KiB
TypeScript
57 lines
1.9 KiB
TypeScript
/**
|
|
* Required External Modules and Interfaces
|
|
*/
|
|
import express, {Request, Response} from 'express';
|
|
import {publicRouter} from './public/public.router';
|
|
import {adminRouter} from './admin/admin.router';
|
|
import {sendServerError} from './feedback.errors';
|
|
|
|
/**
|
|
* Router Definition
|
|
*/
|
|
export const feedbackRouter = express.Router();
|
|
|
|
feedbackRouter.use('/admin', adminRouter);
|
|
feedbackRouter.use('/', publicRouter);
|
|
|
|
/**
|
|
* @swagger
|
|
* /feedback:
|
|
* get:
|
|
* summary: Feedback API root endpoint
|
|
* description: Returns a welcome message for the Nachklang e.V. Feedback API.
|
|
* tags:
|
|
* - feedback
|
|
* responses:
|
|
* 200:
|
|
* description: Success
|
|
* content:
|
|
* text/plain:
|
|
* schema:
|
|
* type: string
|
|
* example: Nachklang e.V. Feedback API Endpoint
|
|
* 500:
|
|
* description: Server error
|
|
* content:
|
|
* application/json:
|
|
* schema:
|
|
* type: object
|
|
* properties:
|
|
* status:
|
|
* type: string
|
|
* example: PROCESSING_ERROR
|
|
* message:
|
|
* type: string
|
|
* example: Internal Server Error. Try again later.
|
|
* reference:
|
|
* type: string
|
|
* example: 6ec1361c-4175-4e81-b2ef-a0792a9a1dc3
|
|
*/
|
|
feedbackRouter.get('/', async (req: Request, res: Response) => {
|
|
try {
|
|
res.status(200).send('Nachklang e.V. Feedback API Endpoint');
|
|
} catch (e: any) {
|
|
sendServerError(res, e);
|
|
}
|
|
});
|