Added some cheatsheets
This commit is contained in:
parent
24faa1e1c1
commit
b9be6c4cbc
|
@ -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')
|
||||||
|
})` //
|
Loading…
Reference in New Issue