HTTP_PORT=3000
cd pdf-playground
npm i
npm start
async function PDF() {
const {code, data} = await ajaxGET('https://jsonplaceholder.typicode.com/posts?userId=2');
return {
content: [
{text: 'Teste do relatório dinâmico\n\n', style: 'header'},
{
style: 'tableExample',
table: {
body: data.map(e => [e.id, e.title, e.userId])
}
}
]
}
}
docker image build -t playground .
docker container run --name playground -p 8000:3000 -e HTTP_PORT=3000 -e NODE_ENV=production playground