/*
Generate an Access Token for a chat application user - it generates a random
username for the client requesting a token, and takes a device ID as a query
parameter.
*/
module.exports = (app) => {
  app.get('/token', (req, res) => {
    const identity = req.body.identity;
    // containing the grant we just created
    var token = new AccessToken(
        process.env.TWILIO_ACCOUNT_SID,
        process.env.TWILIO_API_KEY,
        process.env.TWILIO_API_SECRET
    );

    // Assign the generated identity to the token
    token.identity = identity;

    //grant the access token Twilio Video capabilities
    var grant = new ConversationsGrant();
    grant.configurationProfileSid = process.env.TWILIO_CONFIGURATION_SID;
    token.addGrant(grant);

    // Serialize the token to a JWT string and include it in a JSON response
    res.send({
        identity,
        token: token.toJwt(),
    });
  });
};

@@ -1,8 +1,146 @@
+require('dotenv').load();%0A%0Aconst AccessToken = require('twilio').AccessToken;%0Aconst ConversationsGrant = AccessToken.ConversationsGrant;%0A%0A
 /*%0AGener
@@ -302,16 +302,17 @@
 ter.%0A*/%0A
+%0A
 module.e
@@ -455,19 +455,21 @@
 ted%0A    
-var
+const
  token =
@@ -696,16 +696,17 @@
 %0A%0A    //
+ 
 grant th
@@ -754,11 +754,13 @@
     
-var
+const
  gra
@@ -990,18 +990,16 @@
 %7B%0A      
-  
 identity
@@ -1000,18 +1000,16 @@
 entity,%0A
-  
       to

Add dependencies in twilio route