From b9be6c4cbcb474a2232bca820106ebe05db3599d Mon Sep 17 00:00:00 2001 From: Zoheb Alli Khan Date: Thu, 3 Jun 2021 23:14:49 +0530 Subject: [PATCH] Added some cheatsheets --- backend/express.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/backend/express.js b/backend/express.js index 740bb7b..6796340 100644 --- a/backend/express.js +++ b/backend/express.js @@ -103,8 +103,20 @@ Properties```app.local`; `app.locals.title = "My Cheatsheet"; -console.dir(app.locals.title)`; +console.dir(app.locals.title)`; // Creating objects with local variables app.mountpath` -``app.mountpath``const admin = express()`; +``app.mountpath``const admin = express() +admin.get('/', function(req,res){ + console.log(admin.mountpath) + res.send('Admin Homepage') +}) + +app.use('', admin)`; // Mounting a sub - app + +``Event`` + +`admin.on('mount', (parent){ + console.log('Admin Mounted') +})` // \ No newline at end of file