Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Commit ffdf297

Browse files
Updated codebase structure
1 parent 96e6257 commit ffdf297

File tree

5 files changed

+8
-89
lines changed

5 files changed

+8
-89
lines changed

controllers/home.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Request, Response } from "express";
2+
import SuccessResponse from "../lib/responses/success-response";
23

34
export default class HomeController {
4-
static index(req: Request, res: Response) {
5-
res.render('index.twig');
5+
static async index(req: Request, res: Response) {
6+
return SuccessResponse(res, {});
67
}
78
}

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ process.on('SIGINT', () => process.exit());
4747
app.use('/storage', express.static(path.join(__dirname, '/storage/public')));
4848
app.use(express.static(path.join(__dirname, '/public')));
4949
app.use(corsMiddleware());
50-
app.use('/v1', express.json());
50+
app.use(express.json());
5151

5252
// Register all app routes.
5353
routes(app);

routes/auth.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import AuthValidator from '../validators/auth';
55

66

77
export default (app: Application) => {
8-
app.get('/v1/auth/me', AuthMiddleware, AuthController.getMe);
9-
app.post('/v1/auth/login', AuthValidator.login, AuthController.login);
10-
app.post('/v1/auth/signup', AuthValidator.signup, AuthController.signup);
11-
app.post('/v1/auth/logout', AuthMiddleware, AuthController.logout);
8+
app.get('/me', AuthMiddleware, AuthController.getMe);
9+
app.post('/login', AuthValidator.login, AuthController.login);
10+
app.post('/signup', AuthValidator.signup, AuthController.signup);
11+
app.post('/logout', AuthMiddleware, AuthController.logout);
1212
};

views/index.twig

Lines changed: 0 additions & 17 deletions
This file was deleted.

views/layout.twig

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)