miniflare VS examples

Compare miniflare vs examples and see what are their differences.

miniflare

🔥 Fully-local simulator for Cloudflare Workers. For the latest version, see https://github.com/cloudflare/workers-sdk/tree/main/packages/miniflare. (by cloudflare)

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)
Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
miniflare examples
19 23
3,652 11,237
0.7% 0.5%
7.2 3.3
18 days ago 10 days ago
TypeScript JavaScript
MIT License GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

miniflare

Posts with mentions or reviews of miniflare. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-03-04.

examples

Posts with mentions or reviews of examples. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-14.
  • Deploy a Django application to AWS Lambda using Serverless Framework
    2 projects | dev.to | 14 Dec 2023
    To create a new Serverless service you can run the sls create command and pass a template as a parameter. You can see a list of template examples in the official sls repository. As I write this post, there isn’t a Django template available in this list. Therefore, we are going to create a serverless.yml file in the root directory of our project and manually write the code we need in it.
  • [AskJS] Kicking a dead horse - TS vs JS
    2 projects | /r/javascript | 9 Dec 2023
    Here's an example that deploys a node lambda along with an api gateway with very minimal configuration (check out the serverless.yml).
  • CICD for Serverless Part 2 — AWS CodePipeline Integration
    2 projects | dev.to | 16 May 2022
    Here we’re still using the same Todo list example the folks at the Serverless Framework created as our codebase. But with some variations so that it more cleanly supports automated testing and the CICD toolchain used — AWS CodePipeline.
  • How to use multiple runtimes in a single serverless microservice
    2 projects | dev.to | 27 Apr 2022
    Let’s consider a small application that uses two runtimes and provides two functions. This example will use Python and Node targeting AWS, but the concepts will be broadly applicable in other circumstances. The full the project files can be found here
  • How to Create a Serverless GraphQL API for MySQL, Postgres and Aurora
    4 projects | dev.to | 14 Apr 2022
    You can find the full example project that we’ve been using in this GitHub repo. The easiest way to experiment with the project is to clone the repo and deploy it from your machine using npm run deploy.
  • How to Make a Serverless GraphQL API using Lambda and DynamoDB
    3 projects | dev.to | 11 Apr 2022
    To deploy this service yourself, download the source code and deploy it with the Serverless Framework. Or, take a look at a larger example project for ideas on project structure and factoring.
  • Strategies for implementing user authentication in serverless applications
    3 projects | dev.to | 31 Mar 2022
    You can also find a working implementation of an Authorizer function here in the Serverless Examples repo.
  • Unit testing for Node.js Serverless projects with Jest
    2 projects | dev.to | 29 Mar 2022
    We decided to start with a fresh copy of the aws-node-simple-http-endpoint example in this section:
  • How to publish and use AWS Lambda Layers with the Serverless Framework
    6 projects | dev.to | 24 Mar 2022
    Originally posted at Serverless AWS re:Invent is in full swing, with AWS announcing a slew of new features. Most notably, we’re pretty excited about AWS Lambda’s support for Layers. Layers allows you to include additional files or data for your functions. This could be binaries such as FFmpeg or ImageMagick, or it could be difficult-to-package dependencies, such as NumPy for Python. These layers are added to your function’s zip file when published. In a way, they are comparable to EC2 AMIs, but for functions. The killer feature of Lambda’s Layers is that they can be shared between Lambda functions, accounts, and even publicly! There are two aspects to using Lambda Layers: Publishing a layer that can be used by other functions Using a layer in your function when you publish a new function version. We’re excited to say that the Serverless Framework has day 1 support for both publishing and using Lambda Layers with your functions with Version 1.34.0! See how you can publish and use Lambda Layers with the Serverless Framework below. Example use case: Creating GIFs with FFmpeg For a walkthrough, let’s make a service that takes an uploaded video and converts it to a GIF. We’ll use FFmpeg, a open source tool for manipulating video and audio. FFmpeg is a binary program and a great example use case for a layer as managing the binary falls outside the responsibility of your runtime’s packaging system. In this example, we’ll build and publish a layer that contains FFmpeg. Then, we’ll create a Lambda function that uses the FFmpeg layer to convert videos to GIFs. To get started, create a serverless project for your layer & service: Then at the bottom of your serverless.yml add the following to define your layer that will contain FFmpeg. The path property is a path to a directory that will be zipped up and published as your layer: Run the following commands to download the contents of your layer: You’re ready to test deployment of your layer. Deploy and you’ll see the layer’s ARN in the output info: Next, we’ll add a custom section to serverless.yml to specify the S3 bucket name (choose your own unique bucket name): Now rename your function from hello to mkgif, specify that your function uses the layer you’re publishing, and add an S3 event configuration: You’ll also need to give your service permission to read & write your S3 bucket, add the following in the provider section of your serverless.yml file: Your serverless.yml should now look like this. We need to make our handler. Replace the contents of handler.js with the following code, which gets the file from S3, downloads it to disk, runs ffmpeg on it, reads the GIF, and finally puts it back to S3: Now you can deploy both the layer & updated function with sls deploy. Let’s test it out by uploading a video to our S3 bucket: You now have a GIF copy of the mp4 you uploaded! For the full source of this example, check it out in our examples repo. Some tips on working with layers In the example above, instead of specifying an ARN for the layer that the function is using, we used {Ref: FfmpegLambdaLayer}. This is a CloudFormation Reference. The name is derived from your layer’s name, e.g., ffmpeg becomes FfmpegLambdaLayer. If you're not sure what your layer's name will be, you can find it by running sls package then searching for LambdaLayer in .serverless/cloudformation-template-update-stack.json. You may have noticed that every time you deploy your stack, a new layer version is created. This is due to limitations with CloudFormation. The best way to deal with this is by keeping your layer and your function in separate stacks. Let’s try that with the example we just made. First, create a new folder and move the layers directory into it: Remove the top-level layers section in gifmaker/serverless.yml, then create a new serverless.yml in the ffmpeg-layer folder containing: Now you can run sls deploy to publish your layer! Go back to the gifmaker service directory and change {Ref: FfmpegLambdaLayer} in the serverless.yml to ${cf:ffmpeg-layer-dev.FfmpegLayerExport}. You can now run sls deploy and it'll use the layer from the other service. Note that the dev in the variable above is the stage of your layer service. More Examples You can see the following projects for some examples of using this plugin to build a layer. They all leverage Docker and the docker-lambda images to compile for AWS’s Lambda environment on any operating system: geoip-lambda-layer — A layer containing MaxMind’s GeoIP libraries sqlite-lambda-layer — A layer to fix SQLite support in Python 3.6 runtimes Awesome layers Also check out this repository of awesome layers: https://github.com/mthenw/awesome-layers Custom runtime support: even better! Along with layers support, AWS also just announced support for building your own runtime using the Runtime API. This allows you to build, use, and share runtime support for Lambda outside of what AWS officially supports. Custom runtimes with the Serverless Framework To utilize custom runtimes with Serverless, specify the runtime as provided in your serverless.yml and include a layer that provides a custom runtime. For documentation on building your own runtime, see AWS’s documentation here More re:Invent news All the Serverless announcements at re:Invent 2018 DynamoDB On-Demand: When, why and how to use it in your serverless applications Real-time applications with API Gateway WebSockets and AWS Lambda What Firecracker open-source means for the serverless community
  • How I created URL shortener using Serverless and MongoDB
    4 projects | dev.to | 7 Jan 2022
    This template does not include any kind of persistence (database). For a more advanced examples check out the examples repo which includes Typescript, Mongo, DynamoDB and other examples.

What are some alternatives?

When comparing miniflare and examples you can also consider the following projects:

wrangler-legacy - 🤠 Home to Wrangler v1 (deprecated)

krustlet - Kubernetes Rust Kubelet

hono - Fast, Lightweight, Web-standards

cloudflare-worker-github-app-example - A Cloudflare Worker + GitHub App Example

relay-starter-kit - 💥 Monorepo template (seed project) pre-configured with GraphQL API, PostgreSQL, React, and Joy UI. [Moved to: https://github.com/kriasoft/graphql-starter-kit]

rocket-booster - Lightweight and scalable reverse proxy and load balancing library built for Cloudflare Workers [Moved to: https://github.com/xiaoyang-sde/reflare]

deno - A modern runtime for JavaScript and TypeScript.

workers-chat-demo

sqlite-lambda-layer - A project providing a Lambda Layer that provides SQLite support in Python3.6 Lambdas

serverless-prune-plugin - Serverless Framework plugin to reap unused versions of deployed functions from AWS

cloudflare-docs - Cloudflare’s documentation

deploy_feedback - For reporting issues with Deno Deploy