PAPI-4: Inital Commit for PlutoDev REST API
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user