You are right, serverless mindest is different than a typical cargo app. You can follow the official documentation here: zeit.co/blog/introducing-now-rust
As I mentioned in the article: You don't really create an app when thinking in serverless terms, but you just invoke functions/handlers which process data.
The ZEIT environment will idle your application when it's not needed and start it when triggered (an endpoint is called).
What I meant was that in a real-world case, your serverless endpoint/function will probably want to use business/domain/applicative code that is located and organised elsewhere, in Cargo workspaces, and Zeit's approach does not play well with that.
One way that could work would be to have a directory structure as follows:
Edit: after a quick test, this cannot work either, if the crates that the serverless endpoints depend on (here foo and bar) are not published, which would be the case if they are internal to the project.
Also, not having the Cargo.toml workspace root at the root of the project directory disables RLS, for code completion / formatting etc in VSCode.
I guess this is what people mean when they talk about lock-in with serverless, it's not so much about the platform, but the constraints they impose upon your project structure and dependency management.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks Francois! I changed the filename:
github.com/gruberb/web-programming...
You are right, serverless mindest is different than a typical cargo app. You can follow the official documentation here: zeit.co/blog/introducing-now-rust
As I mentioned in the article: You don't really create an app when thinking in serverless terms, but you just invoke functions/handlers which process data.
The ZEIT environment will idle your application when it's not needed and start it when triggered (an endpoint is called).
What I meant was that in a real-world case, your serverless endpoint/function will probably want to use business/domain/applicative code that is located and organised elsewhere, in Cargo workspaces, and Zeit's approach does not play well with that.
One way that could work would be to have a directory structure as follows:
Edit: after a quick test, this cannot work either, if the crates that the serverless endpoints depend on (here
foo
andbar
) are not published, which would be the case if they are internal to the project.Also, not having the
Cargo.toml
workspace root at the root of the project directory disables RLS, for code completion / formatting etc in VSCode.I guess this is what people mean when they talk about lock-in with serverless, it's not so much about the platform, but the constraints they impose upon your project structure and dependency management.