Sonar helps you commit clean code every time. With over 300 unique rules to find JavaScript bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work. Learn more →
Top 23 JavaScript serverless-framework Projects
-
Previous Serverless Version 0.5.x
⚡ Serverless Framework – Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more! –
-
examples
Serverless Examples – A collection of boilerplates and examples of serverless architectures built with the Serverless Framework on AWS Lambda, Microsoft Azure, Google Cloud Functions, and more. (by serverless)
serverless --template-url=https://github.com/serverless/examples/tree/v3/aws-node-scheduled-cron
-
Appwrite
Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!
-
serverless-express
Run Node.js web applications and APIs using existing application frameworks on AWS #serverless technologies such as Lambda, API Gateway, [email protected], and ALB.
With that in mind, the goal of this library is to be as lightweight as possible. There are other libraries out there that can handle express -> serverless mutation. See Serverless Express for that. If you want to rewrite as little code as possible, that is your best solution. With that being said, if the sole purpose of express is middleware and is only hosting a one-endpoint GraphQL server, I recommend rewriting to utilize this library.
-
Project mention: Implementing Magic Links with Amazon Cognito: A Step-by-Step Guide | dev.to | 2023-03-20
This function uses the Middy middleware engine to handle unhandled errors and add CORS headers in the response.
-
Project mention: Is it possible to use functions requiring a GPU in a serverless google cloud function? | reddit.com/r/googlecloud | 2022-06-14
Please see this thread on some similar implementations to what I'm doing if you are curious: https://github.com/adieuadieu/serverless-chrome/issues/108
-
components
The Serverless Framework's new infrastructure provisioning technology — Build, compose, & deploy serverless apps in seconds... (by serverless)
Today, we’re bringing Serverless Framework Components out of beta, and introducing several new features, including a “serverless dev mode” that enables you to develop on the cloud, via an experience that looks and feels local…
-
A couple months ago, I created the Serverless Step Functions plugin to deploy and manage Step Functions and a bunch of composed Lambda functions via the Serverless Framework.
-
InfluxDB
Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
-
plugins
Serverless Plugins – Extend the Serverless Framework with these community driven plugins – (by serverless)
Project mention: How To Write Your First Plugin For The Serverless Framework — Part 1 | dev.to | 2022-05-18You can ease your pain by using plugins. Some are already built for the most common problems (check them out in the official Serverless Plugins Github repo), but there are always some project-specific issues that plugins can help you resolve. Fortunately, writing a plugin for the Serverless Framework is easier than you might think.
-
serverless-plugin-aws-alerts
A Serverless Framework plugin that creates CloudWatch alarms for functions.
Project mention: Serverless Ops 101 — Using CloudWatch Metrics & Alarms with Serverless Functions | dev.to | 2022-05-04As your Serverless application gets more serious, you will want to track metrics more closely using a tool like DataDog, IOPipe, or Honeycomb. But for quick and easy monitoring, it’s hard to go wrong with CloudWatch and the serverless-plugin-aws-alerts plugin.
-
-
serverless-wsgi
Serverless plugin to deploy WSGI applications (Flask/Django/Pyramid etc.) and bundle Python packages
I hope your head is not spinning. Now you might think, Wait, I have a Flask or my Django app where the framework is taking care of the endpoints in my python code. Do I need to recreate several lambdas? A valid question. Luckily, there is also an awesome Plugin for that.
-
Great point. Fully agree that providing a first-class local development experience is critical to the overall story of application development frameworks.
I guess the main difference is that frameworks like Serverless provide a great experience if you fully buy into their way of doing things (i.e., implement your application assets in the Serverless YAML DSL, etc), whereas LocalStack is a generic platform that works on the API emulation level, hence integrates with most tooling out of the box.
Making the switch from Serverless to, say, AWS CDK, or AWS SAM, or Architect framwork may not be as seamless - however, for each of these frameworks you can always run the local emulation natively on LocalStack. This can help reduce the overall vendor lock-in effect that a lot of application development frameworks come with.
In fact, LocalStack also provides an integration with Serverless [0] - among many other tools [1].
-
express
⚡ Take existing Express.js apps and host them easily on cheap, auto-scaling, serverless infrastructure (AWS Lambda and AWS HTTP API). (by serverless-components)
An example is Serverless Express, one of a handful of Components that are part of today’s release. You can use it to rapidly build Express.js applications on AWS Lambda and AWS HTTP API, to deliver an API that auto-scales massively, and only charges you when it runs ($0.0000002 and $0.0000009 per request).
-
Project mention: How to manage canary deployments on Lambda via the Serverless Framework | dev.to | 2022-04-15
Now, the Canary Deployments Plugin takes care of all those things for you! It makes gradual deployments simply a matter of configuration.
-
serverless-prune-plugin
Serverless Framework plugin to reap unused versions of deployed functions from AWS
-
-
serverless-s3-sync
A plugin to sync local directories and S3 prefixes for Serverless Framework :zap:
You can configure some cache parameters on the S3 level. But you should do this very carefully. For example, if you take example from popular S3 sync plugin for Serverless Framework and upload index.html with below configuration:
-
serverless-mocha-plugin
Plugin for Serverless Framework which adds support for test-driven development using Mocha
For more details about this awesome plugin, check out the Github page.
-
-
a-crash-course-on-serverless-auth
A short and easy boilerplate showcasing JWT auth with Nodejs, the Serverless framework, MongoDB and AWS Lambda.
Project mention: Strategies for implementing user authentication in serverless applications | dev.to | 2022-03-31Originally post at Serverless Searching for a way to do user authentication in your serverless project? Look no further. In this post I’ll be covering robust approaches to storing authentication-related data in serverless applications! We’ll talk about storing user information with sessions and JWT, token validity with Lambda Custom Authorizers, user management from scratch vs hosted services, and so much more. (Spoiler alert: there is no one perfect solution.) I’ll cover a few examples of implementing both authentication and user management, and give my thoughts on the future of authentication mechanisms for the Serverless architecture. I’ll be mentioning the following examples in this post; feel free to check them out beforehand if you’d like: API Gateway + Custom Authorizer + Auth0 Serverless Authentication + Authorization Where to store user information When implementing authentication in your Serverless project, there are two steps: (1) give your users the ability to identify themselves, (2) retrieve their identity in your Serverless functions. The most common ways to accomplish this are storing user sessions, and writing user information inside JSON Web Tokens. Sessions — standard approach Sessions are a standard for storing authentication-related information. Upon authentication, the user gets a token. The token is then sent to the server on every request, and used to look up user information in the database — the status of the session, expiration time, and authentication scopes. Typically, you would store session data in either Redis or Memcached. But for Serverless projects, it makes sense to use hosted datastores instead — Amazon ElastiCache or DynamoDB, Google Cloud Datastore, etc. The down side is, hitting DynamoDB or another datastore to retrieve session information can be a challenge. With a high enough load on your application, retrieving sessions might add a significant amount to the datastore costs and increase page load times for users. Not so optimal. JWT — convenient for serverless Enter JSON Web Tokens (JWT), a growing favorite for serverless projects. The authentication mechanism here is similar to sessions, in that the user gets a token upon logging in, and then sends that token back to the endpoint on every request. But JWT has a key advantage; it makes it easy to store additional user information directly in the token, not just the access credentials. On every request, the user will send the whole token to the endpoint. If you store their username or access scopes in the JWT token, it will be very easy to access that information in every HTTP request you receive. The good This has a number of benefits for serverless projects compared to sessions: you don’t have to access the datastore for getting user information, which can decrease operational costs significantly changing the shape of the data stored in JWT tokens during development is faster, and that enables easier experiments implementing JWT can be just plain easier than reading and writing sessions The bad Unfortunately, JWT isn’t a holy grail: JWT tokens are larger than average session keys, so your clients may be sending more data to your endpoints overall All issued tokens are encrypted with a single keypair. If a leak occurs, the keypair-affected applications would need to invalidate all existing JWT tokens. Clients are allowed to choose the encryption method used on the JWT token issued to them, which could potentially expose additional attack vectors. (This whitepaper on the topic is quite thought-provoking.) Implementing authentication via JWT in a production app certainly requires spending extra time on ensuring that the tokens are used correctly, that you only store the most necessary information in the tokens, and that you are keeping your encryption keys safe. Where to check session or token validity? So when and where should you check the user’s credentials inside your app? One solution would be to check the JWT or session content on every call to any of your functions. This gives you the most control over the authentication flow, but it is complicated to implement; you have to do everything yourself. It’s also not optimal from the database access standpoint. Another solution that improves on some of these issues is using Custom Authorizers supported by API Gateway. Lambda Custom Authorizers AWS Lambda offers a convenient way to perform authentication outside of your core functions. With API Gateway’s Custom Authorizers, you can specify a separate Lambda function that is only going to take care of authenticating your users. In serverless.yml, you can specify custom authorizers as follows: Custom Authorizers are currently only supported in joint use of Amazon API Gateway + Lambda. The Authorizer function has to return a policy of a specific shape. It’s a little inconvenient at first, but gets you access to a lot of flexibility. Amazon provides a blueprint for implementing authorizer functions, which you can find right here. You can also find a working implementation of an Authorizer function here in the Serverless Examples repo. The best part: API Gateway will cache the resulting policy that gets returned by the Authorizer function for up to one hour. If the Custom Authorizer gets user information from, say, DynamoDB, this caching is going to reduce DynamoDB traffic significantly and improve the load times of your Serverless app’s endpoints. Nice. Check out our documentation on using the Custom Authorizers with the Serverless Framework. User management from scratch vs hosted services To manage users, you’ll need to create and delete them, as well as log them in and out. So the the big question is: should you manage users entirely yourself, or use a hosted service? Implementing it yourself This basically requires a CRUD interface for your Users database, plus a login method to generate a new JWT token or to create a session. Those can be implemented as separate functions. I found this example to be very useful. The Register User function is simply: Which then gets wrapped in a handler: And specified in the serverless.yml: You can find the full example in this GitHub repo. Using hosted services Services like Auth0 and Amazon Cognito handle creating users, logging them in, and storing sessions. If your goal is to allow users to log in with their social accounts or their corporate SAML identities, this is especially useful. With Auth0, your app’s frontend gets a JS element via the Auth0 SDK that displays a nice-looking login window, as in the example here: And then your Authorizer function will check the user’s token using the Auth0 public key: All without a need for you to maintain the Users database. Pretty slick. Conclusion We’re unfortunately still in the early stages of authentication for serverless. While API Gateway provides a convenient way to implement authorization for Lambda functions (with, logically, more Lambda functions), other serverless compute providers don’t offer ways to conveniently authenticate users. And even authorizer functions in Lambda have their issues, with fairly complex policies and caching limitations. We are eager to see what solutions for authentication the serverless compute providers offer going forward, and are always happy to hear from you about how you’re handling authentication. Feel free to drop a comment, post in our forum, or hit us up on Twitter.
-
Project mention: Week of Java: Part 2: Setting Up Your Local Development Environment | dev.to | 2022-05-11
Now we are ready to install plugins! Let’s try serverless-sam, a plugin that converts serverless.yml **files to **template.yml (the one required by SAM Local).
-
function main() { return { headers: { location: 'http://openwhisk.org' }, statusCode: 302 } }
-
serverless-media-portal
Ready-to-deploy webapp for sharing home videos: a React frontend with a AWS Lambda backend using FFmpeg to process videos. Created using Serverless Framework.
-
Sonar
Write Clean JavaScript Code. Always.. Sonar helps you commit clean code every time. With over 300 unique rules to find JavaScript bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.
JavaScript serverless-framework related posts
- Consulta: buenas practicas AWS
- Deploying Lambdas from Zipped Code on S3 vs Image Repository
- [p] I built an open source platform to deploy computationally intensive Python functions as serverless jobs, with no timeouts
- AWS Lambda, a good host for a rest API?
- How are you deploying cloud functions (GCF/Lambda/Firebase/whatever) from your monorepos?
- Key learnings after 10h diving into Lambda, js and Github Actions
- Does anyone use serverless framework with Workers?
-
A note from our sponsor - Sonar
www.sonarsource.com | 24 Mar 2023
Index
What are some of the best open-source serverless-framework projects in JavaScript? This list will help you:
Project | Stars | |
---|---|---|
1 | Previous Serverless Version 0.5.x | 44,436 |
2 | examples | 10,749 |
3 | serverless-express | 4,776 |
4 | middy | 3,276 |
5 | serverless-chrome | 2,749 |
6 | components | 2,313 |
7 | serverless-step-functions | 963 |
8 | plugins | 947 |
9 | serverless-plugin-aws-alerts | 517 |
10 | serverless-stack-demo-api | 515 |
11 | serverless-wsgi | 455 |
12 | serverless-localstack | 453 |
13 | express | 374 |
14 | serverless-plugin-canary-deployments | 361 |
15 | serverless-prune-plugin | 333 |
16 | serverless-dotenv-plugin | 324 |
17 | serverless-s3-sync | 165 |
18 | serverless-mocha-plugin | 159 |
19 | hyperform | 158 |
20 | a-crash-course-on-serverless-auth | 156 |
21 | serverless-sam | 151 |
22 | serverless-openwhisk | 140 |
23 | serverless-media-portal | 97 |