API-13: Adding PartyPlaner main endpoint (#2)
Jenkins Production Deployment

- Also did some refactoring for cleaner code

Co-authored-by: Patrick Müller <patrick@mueller-patrick.tech>
Reviewed-on: #2
Co-authored-by: Patrick Müller <patrick@plutodev.de>
Co-committed-by: Patrick Müller <patrick@plutodev.de>
This commit was merged in pull request #2.
This commit is contained in:
2021-08-18 12:02:59 +00:00
parent 5ef4fdb4e2
commit 7df8b5ad8e
8 changed files with 100 additions and 8 deletions
@@ -0,0 +1,22 @@
/**
* Required External Modules and Interfaces
*/
import express, {Request, Response} from 'express';
import {generalInfoRouter} from "./generalInfo/GeneralInfo.router";
/**
* Router Definition
*/
export const dhbwServiceRouter = express.Router();
// Sub-Endpoints
dhbwServiceRouter.use('/generalInfo', generalInfoRouter);
generalInfoRouter.get('/', async (req: Request, res: Response) => {
try {
res.status(200).send(`Pluto Development DHBW Service App API Endpoint`);
} catch (e) {
console.log('Error handling a request: ' + e.message);
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
}
})
@@ -19,7 +19,7 @@ generalInfoRouter.get('/', async (req: Request, res: Response) => {
generalInfoRouter.post('/', async (req: Request, res: Response) => {
try {
res.status(200).send(`GET generalInfo v2.1`);
res.status(200).send(`POST generalInfo v2.1`);
} catch (e) {
console.log('Error handling a request: ' + e.message);
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
@@ -0,0 +1,22 @@
/**
* Required External Modules and Interfaces
*/
import express, {Request, Response} from 'express';
import {dataRouter} from "./data/Data.router";
/**
* Router Definition
*/
export const partyPlanerRouter = express.Router();
// Sub-Endpoints
partyPlanerRouter.use('/data', dataRouter);
partyPlanerRouter.get('/', async (req: Request, res: Response) => {
try {
res.status(200).send(`Pluto Development PartyPlaner API Endpoint V2`);
} catch (e) {
console.log('Error handling a request: ' + e.message);
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
}
})
@@ -0,0 +1,27 @@
/**
* Required External Modules and Interfaces
*/
import express, {Request, Response} from 'express';
/**
* Router Definition
*/
export const dataRouter = express.Router();
dataRouter.get('/', async (req: Request, res: Response) => {
try {
res.status(200).send(`GET data`);
} catch (e) {
console.log('Error handling a request: ' + e.message);
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
}
})
dataRouter.post('/', async (req: Request, res: Response) => {
try {
res.status(200).send(`POST data`);
} catch (e) {
console.log('Error handling a request: ' + e.message);
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
}
})
@@ -0,0 +1,21 @@
/**
* Required External Modules and Interfaces
*/
import express, {Request, Response} from 'express';
import {addHighlightRouter} from "./addHighlight/AddHighlight.router";
/**
* Router Definition
*/
export const highlightMarkerRouter = express.Router();
highlightMarkerRouter.use('/addHighlight', addHighlightRouter);
highlightMarkerRouter.get('/', async (req: Request, res: Response) => {
try {
res.status(200).send(`Pluto Development Twitch Highlight Marker API Endpoint`);
} catch (e) {
console.log('Error handling a request: ' + e.message);
res.status(500).send(JSON.stringify({'message': 'Internal Server Error. Try again later.'}));
}
})