Giter VIP home page Giter VIP logo

vapor-aws-lambda-runtime's Issues

Help with how to use it - Possibly a bit more info in the Readme

Experimenting with this, and setting up a vapor service using pulumi scripts in aws.
In terms of what's needed in the swift vapor code, is it enough to just do this here:

app.servers.use(.lambda)

Or is there anything else I would need to do per endpoint, to get this working?

Follow Vapor 4's provider pattern

@tanner0101 suggested:

Creating a community package that follow's Vapor 4's provider pattern could be a good next step
Something like:

import Vapor
import Lambda

let app = Application(...)
defer { app.shutdown() }

app.lambda.enable()

try app.run()

Returning Protobuf binary data seems to truncate in AWS

Have managed to get a nice API proof of concept for JSON responses, but having a hard time doing it for protobuf data.

Already wrote the code to have my vapor API return protobuf data with the appropriate contentType of "application/protobuf" based on whether the client sends an Accept header with application/protobuf, all that works when I run my vapor API locally (both running via docker or just swift run).

But trying to make use of that when the service is running in AWS doesn't work.

After a bit of poking around, I've figured out that the aws RestApi declaration in AWS needed a declaration for "binary_media_types".

For example:
binary_media_types=["application/protobuf"]

But it still does not work.

As far as I can tell, it might just require a modification to check the contentType for application/protobuf before creating the APIGateway Response, in these files here:

if let string = response.body.string {

if let string = response.body.string {

Just wanted to raise it as a possible feature request, think it would be pretty cool.
If its already possible to get this working somehow, then I would greatly appreciate any hints or information that might help.

Thanks for making such an awesome library !

Local Lambda Debugging

The swift-was-lambda-runtime project has added the ability to run a local lambda server by setting the LOCAL_LAMBDA_SERVER_ENABLED environment variable to "true." I tried this with the Vapor integration and it does not seem to work.

It would be nice if this worked so I could run / debug inside Xcode on my Mac.

If you do not have time to do it, I have looked a little and am not sure where to look. Do you know where I would start to look into fixing this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.