- 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:
@@ -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.'}));
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user