This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-global | |
- log 127.0.0.1 local0 | |
- log 127.0.0.1 local1 notice | |
- | |
- | |
-defaults | |
- mode http | |
- option httplog | |
- option dontlognull | |
- timeout connect 5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (config) => ({ | |
compiler_public_path: `http://${config.server_host}:${config.server_port}/`, | |
proxy: { | |
enabled: true, | |
options: { | |
// koa-proxy options | |
host: 'http://localhost:4000', | |
match: /^\/api\/.*/ | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const Hapi = require('hapi'); | |
const server = new Hapi.Server(); | |
server.connection({ port: 3000 }); | |
const myBigFatArray = []; | |
server.route({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function whoAmI() { | |
console.log(this); | |
} | |
whoAmI(); | |
// Output => undefined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function whoAmI() { | |
console.log('I am in local scope:', this); | |
} | |
console.log('I am in global scope:', this); | |
whoAmI(); | |
// Output in Node | |
// I am in global scope: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function whoAmI() { | |
console.log('I am in local scope:', this); | |
function insideFunction() { | |
console.log('I am an inside function:', this); | |
} | |
insideFunction(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function whoAmI() { | |
console.log('I am in local scope:', this); | |
function insideFunction() { | |
console.log('I am an inside function:', this); | |
} | |
insideFunction(); | |
} | |
this.myName = 'Abhinav'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function whoAmI() { | |
console.log('I am in local scope:', this); | |
function insideFunction() { | |
console.log('I am an inside function:', this); | |
} | |
insideFunction.apply(this); | |
} | |
this.myName = 'Abhinav'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function whoAmI() { | |
console.log('I am in local scope:', this); | |
this.insideFunction = function () { | |
console.log('I am an inside function:', this); | |
} | |
this.insideFunction(); | |
} | |
this.myName = 'Abhinav'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const testObj = { | |
a: 10, | |
whoamI: function() { | |
console.log(this); | |
} | |
}; | |
testObj.whoamI(); |
OlderNewer