Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const Abstract = require("abstract-sdk");
// set the port of our application
// process.env.PORT lets the port be set by Heroku
let port = process.env.PORT || 3000;
nunjucks.configure("src/views", {
autoescape: true,
express: app,
watch: true
});
app.use(express.static(__dirname + "/src/assets"));
// Create a client
const abstract = Abstract.Client();
const theProjects = [];
async function getAllProjects() {
// Query all projects
const projects = await abstract.projects.list().catch(error => {
console.log(error);
});
return projects;
}
async function getComments(projectId) {
const comments = await abstract.comments
.list({
projectId: projectId
#!/usr/bin/env node
const {
promises: { writeFile, copyFile, mkdtemp, mkdir, stat },
} = require('fs');
const { join } = require('path');
const { tmpdir } = require('os');
const fetch = require('node-fetch');
const shell = require('shelljs');
const chalk = require('chalk');
const AbstractSDK = require('abstract-sdk');
const xml2js = require('xml2js');
const dotenv = require('dotenv');
dotenv.config();
const abstract = new AbstractSDK.Client({
transportMode: 'cli',
});
const {
ABSTRACT_PROJECT_ID,
REMOTE_USER,
REMOTE_HOST,
REMOTE_PATH_BASE,
URL_BASE,
SHOULD_FORCE_PUBLISH,
} = process.env;
const URL_BASE_GUI_PACK = `${URL_BASE}/gui-pack`;
const INTERVAL_POLL = 10 * 60 * 1000; // 10 minutes
const URL_ICON = `${URL_BASE_GUI_PACK}/icon.png`;