mirror of
https://github.com/LeCoupa/awesome-cheatsheets.git
synced 2025-11-08 14:01:35 +00:00
Added some cheatsheets
This commit is contained in:
@@ -103,8 +103,20 @@ Properties```app.local`;
|
|||||||
|
|
||||||
`app.locals.title = "My Cheatsheet";
|
`app.locals.title = "My Cheatsheet";
|
||||||
|
|
||||||
console.dir(app.locals.title)`;
|
console.dir(app.locals.title)`; // Creating objects with local variables
|
||||||
|
|
||||||
app.mountpath`
|
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 dir>', admin)`; // Mounting a sub - app
|
||||||
|
|
||||||
|
``Event``
|
||||||
|
|
||||||
|
`admin.on('mount', (parent){
|
||||||
|
console.log('Admin Mounted')
|
||||||
|
})` //
|
||||||
Reference in New Issue
Block a user