vladholubiev / serverless-libreoffice

Run LibreOffice in AWS Lambda to create PDFs & convert documents
https://vladholubiev.com/serverless-libreoffice
514 stars 75 forks source link

API Gateway example? #2

Closed rickmills closed 6 years ago

rickmills commented 6 years ago

Firstly just wanted to say that you've done a fantastic job here, this seems like it could lead to a really neat way of handling file conversion tasks without having to pay through the nose for expensive third parties.

I'm currently setting up your scripts to have a play with this for a project idea, I noticed on your site you use an AWS API Gateway. This isn't something I've used before but if my understanding is correct, you can push file uploads directly to that, and presumably you've got a script there that handles pushing on to s3/lambda right? Do you have a sample file for API Gateway available?

jenstroeger commented 6 years ago

Agreed with @rickmills, great job!

One question, @vladgolubev: is the UNO bridge still functional?

vladholubiev commented 6 years ago

Hey @rickmills, thanks for the kind words!

API Gateway is mostly for the demo purposes. It's the fastest to setup but adds an additional layer of complexity if you have an existing app. Unfortunately, I set it up on the AWS Console UI, so there isn't really a way to share it. The good thing, it is so simple so you better try it yourself, literally just 2 clicks on a wizard to wire API GW with 1 Lambda.

But when it comes to system design in existing business app, I'd think of:

And just in case you haven't seen it yet, the demo code is here. Just forgive my front-end skills, I don't really work with this stuff day-to-day 😅 https://github.com/vladgolubev/vladholubiev.com/blob/master/src/website/pages/serverless-libreoffice.js

vladholubiev commented 6 years ago

@jenstroeger great question! Would be awesome if someone could try it and share. I certainly lack Python knowledge for that. But it's a lucrative piece - it will be much faster, w/o CLI spawn overhead + ability to pass tons of parameters, the most useful IMO is pages range.

jenstroeger commented 6 years ago

@vladgolubev, there are many implementation (i.e. language bindings) for UNO, see here. Java, Python, C++, … my hope is that the serverless-libreoffice retained all of the UNO functionality in tact, so that a client can connect using any of the languages.

vladholubiev commented 6 years ago

@jenstroeger I'm afraid I need help with UNO, frankly don't have a clue about it. I'm glad to collaborate with someone who can verify this!