standard-library / wire-o Goto Github PK
View Code? Open in Web Editor NEWAWS Lambda function for PDF binding
AWS Lambda function for PDF binding
Regarding #13, Lambda should have cloudformation:describeStacks
permission.
It would be nice to be able to compile and deploy in one step. Currently, deployment consists of building the final bundle, and then running the deployment command.
Ideally, this should be one step, e.g. npm run deploy
.
Want to add Serverless (https://serverless.com/) to streamline and make the installation process easier.
This is the repsonse from the API
{
"errorMessage": "Cannot find module 'babel-runtime/regenerator'",
"errorType": "Error",
"stackTrace": [
"Module.require (module.js:497:17)",
"require (internal/module.js:20:19)",
"Object. (/var/task/dist/app.js:3:20)",
"Module._compile (module.js:570:32)",
"Object.Module._extensions..js (module.js:579:10)",
"Module.load (module.js:487:32)",
"tryModuleLoad (module.js:446:12)",
"Function.Module._load (module.js:438:3)"
]
}
I am completley new to babel and npm, so tried some links i found in web by changing babel versions but it did not solve the issue.
Cloud watch logs :
Unable to import module 'dist/app': Error
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/var/task/dist/app.js:3:20)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
Is this related to new babel version?
My pacagke.json diff
},
"dependencies": {
"aws-sdk": "^2.6.9",
The gs
command should be pre-installed on linux, and give us a good utility for merging PDFs without the overhead or bugs that are part of the PDFMerge library.
https://www.linux.com/news/putting-together-pdf-files
http://stackoverflow.com/questions/8158584/ghostscript-to-merge-pdfs-compresses-the-result
This isn't a crucial change, but would be nice to shed the dependency on this library and shell out to Ghostscript to do the actual merge. This would be a better foundation to start adding additional functionality like stamping pages with a timecode, or adding page numbers—which seems to be supported by GS.
$ npm run deploy
[email protected] deploy /Users/xxx/Documents/www/node/wire-o
babel lib --out-dir dist && serverless deploy
lib/app.js -> dist/app.js
lib/download.js -> dist/download.js
lib/downloadPdfs.js -> dist/downloadPdfs.js
lib/formatResponse.js -> dist/formatResponse.js
lib/mergePdfs.js -> dist/mergePdfs.js
lib/storePdf.js -> dist/storePdf.js
lib/tmpDirectory.js -> dist/tmpDirectory.js
lib/uploadToS3.js -> dist/uploadToS3.js
Error --------------------------------------------------
ServerlessError: ServerlessError: User: arn:aws:iam::XXX:user/mscore
is not authorized to perform: cloudformation:DescribeStackResources
on resource: arn:aws:cloudformation:us-east-1:XXX:stack/wire-o-dev/*
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Forums: forum.serverless.com
Chat: gitter.im/serverless/serverless
Your Environment Information -----------------------------
OS: darwin
Node Version: 6.9.5
Serverless Version: 1.11.0
...
Unable to follow the steps after creating the wire-o.yml file. Not clear on how to create it plus what to do next.
After the Wire-O
heading in the readme, a short (one sentence) description should explain the main points: AWS Lambda, JavaScript, merge PDFS, ?.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.