Accessing the functions in express on client side using the require — Node js
问题 I have a to access the config variables defined in the file called test.js which has -- var aws = require('aws-sdk'); exports.connect = function(){ return aws; } Now I need to access it when the OnClick event occurs on the browser. I have this script but the require module does not work. clientScript.js var aws = require('../scripts/test.js').connect(); function getValue() { aws.describe({},function(){...}) } How can I access this aws variable? 回答1: You can't use require() on the client side,