13 - Clean Up Your Project with Modules - Advanced Node and Express - freeCodeCamp
Ganesh H
We're gonna clean up our project now by splitting it into 3 files. We can use Node's module.exports and require() functionalities to achieve this.
Link to Challenge : https://www.freecodecamp.org/learn/quality-assurance/advanced-node-and-express/clean-up-your-project-with-modules Written Guide: https://www.notion.so/ganeshh123/Clean-Up-Your-Project-with-Modules-c6ff5d81d81e49dc863fc4a3d60a0e9a
Full Playlist for this course : https://www.youtube.com/playlist?list=PLhGp6N0DI_1RL9djhgSH65pZhJ6xSyKX8 All Writen Guides for this course : https://www.notion.so/ganeshh123/ccf6039186334f83a54c1c9216f30e3c All My Tutorials can be found at : https://www.notion.so/Tutorials-Ganesh-H-293ea420d34a464f9a1907e0405b5f26
00:00 - How we can Organize our Project 00:36 - Exporting Code - module.exports The module.exports is a special object which is included in every JavaScript file in the Node.js application by default. The module is a variable that represents the current module, and exports is an object that will be exposed as a module. So, whatever you assign to module.exports will be exposed as a module. https://www.tutorialsteacher.com/nodejs/nodejs-module-exports 01:13 - Moving our Authentication Code to auth.js 04:03 - Moving our Routing Code to routes.js 05:16 - Importing Code - require() Node.js follows the CommonJS module system, and the builtin require function is the easiest way to include modules that exist in separate files. The basic functionality of require is that it reads a JavaScript file, executes the file, and then proceeds to return the exports object. https://nodejs.org/en/knowledge/getting-started/what-is-require/ 05:52 - Challenge Solution
-————————————————————————————————————- Node.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside a web browser. Node.js lets developers use JavaScript to write command line tools and for server-side scripting—running scripts server-side to produce dynamic web page content before the page is sent to the user's web browser.
Express.js, or simply Express, is a web application framework for Node.js. It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js. Express runs between the server created by Node.js and the frontend pages of a web application. Express also handles an application's routing.
freeCodeCamp (also referred to as “Free Code Camp”) is a non-profit organization that consists of an interactive learning web platform, an online community forum, chat rooms, online publications and local organizations that intend to make learning web development accessible to anyone. Beginning with tutorials that intro ... https://www.youtube.com/watch?v=eyDF8QmPS7A
46720130 Bytes