Open 3bdoYasser opened 1 year ago
CREATE README.md
# simple-test
CREATE app.js
const express = require('express');
const app = express();
const port = 3000;
const homeController = require('./controllers/homeController');
app.get('/', homeController.index);
app.listen(port, () => {
console.log(`App listening at http://localhost:${port}`)
});
CREATE package.json
{
"name": "simple-test",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"start": "node app.js"
},
"dependencies": {
"express": "^4.17.1"
}
}
CREATE controllers/homeController.js
exports.index = function(req, res) {
res.send('Hello World!');
};
CREATE controllers/testController.js
exports.test = (req, res) => {
res.send('Hello World!');
};
CREATE models/homeModel.js
// This file is intentionally left blank as a placeholder for future model definitions.
CREATE routes/testRoute.js
const express = require('express');
const testController = require('../controllers/testController');
const router = express.Router();
router.get('/', testController.test);
module.exports = router;
CREATE views/homeView.js
// This file is intentionally left blank as a placeholder for future view definitions.
This project is a simple Express.js application. It has a basic file structure with a main application file (app.js), a package.json file for managing dependencies, and a README.md file for documentation.
The application has two controllers: homeController and testController. Each controller has a single function that sends a 'Hello World!' response when their respective routes are accessed.
The routes for these controllers are defined in the app.js file and the testRoute.js file.
The models and views directories currently contain placeholder files for future development.
make professional presentation that explain all things in the poject