Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
credentials = require('../credentials.js');
APP_ID = credentials.APP_ID;
APP_SECRET = credentials.APP_SECRET;
AUTH_TOKEN = credentials.AUTH_TOKEN;
DEST_EMAIL = credentials.DEST_EMAIL;
var app = express();
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
// setup the Nylas API
global.Nylas = require('nylas').config({
appId: APP_ID,
appSecret: APP_SECRET,
});
// uncomment after placing your favicon in /public
//app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', routes);
app.use('/threads', threads);
// catch 404 and forward to error handler
clientSecret: '',
};
assert.notEqual(
nylasAppConfigs.clientId,
'',
'Please replace with your Nylas Client ID'
);
assert.notEqual(
nylasAppConfigs.clientSecret,
'',
'Please replace with your Nylas Client Secret'
);
// setup the Nylas API
global.Nylas = require('nylas').config(nylasAppConfigs);
app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
var sessionSecret = {
secret: '',
};
assert.notEqual(
sessionSecret.secret,
'',
'Please replace with your session secret'
);
var Nylas = require('nylas').config({
appId: 'blah',
appSecret: 'blah',
apiServer: 'https://api-staging.nylas.com/',
});
credentials = require('./credentials.js');
AUTH_TOKEN = credentials.AUTH_TOKEN;
DEST_EMAIL = credentials.DEST_EMAIL;
var nylas = Nylas.with(AUTH_TOKEN);
var timestampMs = Date.now();
nylas.deltas.generateCursor(timestampMs, function(error, cursor) {
var stream = nylas.deltas.startStream(cursor);