Initial commit
This commit is contained in:
24
src/routes/homeRouter.ts
Normal file
24
src/routes/homeRouter.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import express, {Request, Response} from "express";
|
||||
|
||||
const router = express.Router();
|
||||
import { homeData } from "../data/homeData";
|
||||
import { homeController } from "../controllers/homeController";
|
||||
|
||||
router.get('/', (_: Request, res: Response) => {
|
||||
|
||||
const homePageData: homeData = {
|
||||
title: 'Welcome to the Home Page',
|
||||
content: 'This is the home page content.',
|
||||
date: new Date(),
|
||||
index: () => {
|
||||
console.log('Index function called');
|
||||
}
|
||||
}
|
||||
res.status(200).send({homePageData})
|
||||
});
|
||||
|
||||
router.get('/home', homeController.index);
|
||||
router.get('/about',homeController.about);
|
||||
router.get('/contact',homeController.contact);
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user