This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": [ | |
"Afghanistan", | |
"Akrotiri", | |
"Albania", | |
"Algeria", | |
"American Samoa", | |
"Andorra", | |
"Angola", | |
"Anguilla", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const NodeClam = require('clamscan'); | |
module.exports = async function scanFile(filePath) { | |
console.log(`Attempting virus scan for ${filePath}`); | |
const clamscan = await new NodeClam().init({ | |
remove_infected: true, | |
debug_mode: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
const nunjucks = require('nunjucks') | |
const express = require('express') | |
const app = express() | |
const port = 3004 | |
nunjucks.configure([ | |
path.join(__dirname, 'node_modules/govuk-frontend/'), | |
path.join(__dirname, 'app/views/') | |
], { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gulp = require('gulp') | |
const sass = require('gulp-sass') | |
const compileStyles = () => { | |
return gulp.src([ | |
'app/assets/sass/**/*.scss' | |
]) | |
.pipe(sass()) | |
.pipe(gulp.dest('public/css/')) | |
.on('error', (err) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pdfMakePrinter = require('pdfmake/src/printer'); | |
function generatePdf(docDefinition, callback) => { | |
try { | |
const fontDescriptors = { ... }; | |
const printer = new pdfMakePrinter(fontDescriptors); | |
const doc = printer.createPdfKitDocument(docDefinition); | |
let chunks = []; | |
const result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pdfMakePrinter = require('pdfmake/src/printer'); | |
function generatePdf(docDefinition, callback) => { | |
try { | |
const fontDescriptors = { ... }; | |
const printer = new pdfMakePrinter(fontDescriptors); | |
const doc = printer.createPdfKitDocument(docDefinition); | |
let chunks = []; | |
const result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
await strapi.plugins['email'].services.email.send({ | |
to: ctx.request.body.to, | |
from: '[email protected]', | |
replyTo: '[email protected]', | |
subject: 'My message', | |
text: 'Text', | |
html: '<h1>Text</h1>' | |
}, config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const app = express() | |
const nunjucks = require('nunjucks') | |
const path = require('path') | |
nunjucks.configure([ | |
path.join(__dirname, 'node_modules/govuk-frontend/'), | |
path.join(__dirname, 'app/views/') | |
], { | |
autoescape: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"routes": [ | |
{ | |
"method": "POST", | |
"path": "/email", | |
"handler": "Email.send", | |
"config": { | |
"policies": [] | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const formidable = require('formidable'); | |
module.exports = function (req, res, next) { | |
const formData = new formidable.IncomingForm(); | |
formData | |
.parse(req, (err, fields, files) => { | |
if (err) { | |
next(err); | |
} else { |
NewerOlder