Comments (6)
actually, we do not need to start the application locally, right? with this in mind, i removed the whole handler stuff from sample, so what's left to do for a user is to specify the ktor application and reference the LambdaAdapter::handle
method in the serverless.yml
.
should be very easy to use.
from ktor-server-lambda.
Looks great so far. I wonder if we can keep (parts of) the Handler.kt file just for local development purposes? I would really love to be able to start the API on my machine
from ktor-server-lambda.
Yeah, I would like that too :) what do you think about some configuration option when starting the app? E.g. declaring a constant in LambdaAdapter, that can be passed to the LambdaEngine from the main function, which in turn enables delegation to the CIO Engine? Something like this
from ktor-server-lambda.
Im not quite sure about this Handler.kt
until this line and rename it to something like Launcher.kt
it should work without modifications of the LambdaAdapter/Engine, shouldnt it? Especially after your last changes to the LambdaAdapter.
from ktor-server-lambda.
the problem with the current LambdaEngine is, that the main thread won't be kept alive. If you run the main function, the program will be stopped after a short period of time.
If you have a deeper look into CIOEngine, you'll see that there are coroutines being started that stop the application from being shut down.
I think the question is: what do you want to test locally?
if it's only the ktor application itself, I would say it's enough to re-use the CIOEngine.
if you want to simulate the lambda environment, then we'll need to block in the LambdaEngine ourselves.
from ktor-server-lambda.
after talking to @otbe my confusion is now resolved and i simply re-added the original main function
from ktor-server-lambda.
Related Issues (16)
- Rename base package HOT 1
- Should we support binary responses?
- Add README
- Use maven:release when merging to master HOT 2
- Remove @EngineAPI from example code HOT 1
- Running somewhere else than AWS? HOT 1
- Build HOT 6
- Use common code style HOT 1
- Maven deployment HOT 8
- Tests HOT 1
- Verify LambdaApplicationRequest impl
- Verify LambdaApplicationResponse impl HOT 1
- Cleanup LambdaEngine impl
- Provide example
- Pass APIG requestContext to the execution pipeline
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ktor-server-lambda.