Skip to content

Commit 882b2e2

Browse files
committed
feat: add MyFileController and my-file view for file management
1 parent 08caa1d commit 882b2e2

File tree

3 files changed

+264
-0
lines changed

3 files changed

+264
-0
lines changed

src/client/controller/my-file.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { NextFunction, Request, Response } from "express";
2+
import { Controller } from "./controller.js";
3+
4+
export class MyFileController extends Controller {
5+
6+
public static get(request: Request, response: Response, next: NextFunction) {
7+
const currentPath = request.path;
8+
9+
const pageData = {
10+
...Controller.defaultConfig,
11+
page: 'my-file',
12+
title: 'My Files - CloudBox',
13+
currentPath
14+
};
15+
16+
response.render('layouts/main', pageData);
17+
}
18+
19+
}

src/client/routes/web.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import express, { Request, Response } from 'express';
22
import path from 'path';
33
import { fileURLToPath } from 'url';
44
import { DashboardController } from '../controller/dashboard.js';
5+
import { MyFileController } from '../controller/my-file.js';
56

67
const __filename = fileURLToPath(import.meta.url);
78
const __dirname = path.dirname(__filename);
@@ -19,6 +20,7 @@ app.set('views', path.join(__dirname, './../views'));
1920

2021

2122
app.get('/', DashboardController.get);
23+
app.get('/files', MyFileController.get);
2224

2325

2426
export default app;

0 commit comments

Comments
 (0)