I am currently trying to integrate a javascript file into an HTML page but I am having difficulties with errors arising when running the page through a node.js server. Specifically, the error is with the following code:
var Twit = require('twit'),
var client = new Twit({
consumer_key: '',
consumer_secret: '',
access_token: '',
access_token_secret: '',
timeout_ms: 60*1000,
}),
The error raise is that require is not a function. To resolve this I moved the above code into app.js but I am now unsure how to include Twit
and Client
into my javascript file? As the functions within my javascript file now cannot seem to access these variables.