PAPI-4: Inital Commit for PlutoDev REST API

This commit is contained in:
2021-02-16 22:55:50 +01:00
commit 57059b0b2f
7 changed files with 2020 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import express from 'express';
export abstract class CommonRoutesConfig {
app: express.Application;
name: string;
constructor(app: express.Application, name: string) {
this.app = app;
this.name = name;
this.configureRoutes();
}
getName() {
return this.name;
}
abstract configureRoutes(): express.Application;
}
@@ -0,0 +1,20 @@
import {CommonRoutesConfig} from '../../common/common.routes.config';
import express from 'express';
export class GeneralInfoRoutes extends CommonRoutesConfig {
constructor(app: express.Application) {
super(app, 'GeneralInfoRoutes');
}
configureRoutes() {
this.app.route(`/dhbw-service/generalInfo`)
.get((req: express.Request, res: express.Response) => {
res.status(200).send(`List of users`);
})
.post((req: express.Request, res: express.Response) => {
res.status(200).send(`Post to users`);
});
return this.app;
}
}