Questions tagged [serverless]

Serverless technology represents a paradigm shift in cloud computing, as it allows the cloud provider to efficiently allocate machine resources based on application demand. In this model, pricing is determined by the actual usage of resources rather than predefined capacity units purchased upfront. Essentially, serverless computing operates similarly to utility services, providing scalability and cost-efficiency for applications running in the cloud.

Efficiently handling AWS Lambda responses by sending them before awaiting the completion of a database query using the

I am currently working on a serverless framework node js function that initializes a mysql DB and runs a query using ES6 to return an HTTP response. Is there a way for the response to be returned before the completion of the DB call? For example, in ...

What could be causing my Node.js express application to crash with the error message 'This Serverless Function has crashed' when trying to connect to a Sequelize Database on Vercel?

I'm having trouble deploying my Node.js express app to vercel. I keep encountering this error message: "This serverless function has crashed." I can't seem to pinpoint the issue. In my root project folder, I have an index.js file where I initialize the ap ...

Is there a way to verify the functionality of DigitalOcean features using doctl before transitioning to a live environment?

As a newcomer to using DigitalOcean Functions, I have set up some JavaScript namespaces using the doctl serverless command. My main query is regarding testing DigitalOcean functions locally before deploying them to production. Is there a way to do this wit ...

Steps to invoke the Express JS code repository from a serverless repository

Within my current project, there exists various repositories housing Angular code, Express JS (node JS) code, and AWS serverless components. For a specific feature, I am tasked with transferring the 'userId' value from the Angular code to the ser ...

Developing a principal account Twilio client within a subaccount node operation

I am currently working on a Twilio function in a subaccount that needs to connect to a Twilio client in the main account. The function is being deployed via a Github action to the subaccount. To achieve this, I have the following code in my subaccount fun ...

Difficulties Encountered when Converting HTML to PDF with Puppeteer on AWS Lambda

HTML TO PDF Struggling with the conversion of HTML to PDF using Puppeteer in a Node.js 16 AWS Lambda environment is proving to be quite challenging. Puppeteer's performance seems to vary when deployed on AWS Lambda or serverless setups, despite work ...

The serverless-plugin-split-stacks plugin does not reduce the overall resources in the root configuration when deployed serverlessly

After implementing the configuration changes for the serverless-plugin-split-stacks plugin, I noticed that the number of resources in the main stack remains unchanged. This poses a problem because CloudFormation has a maximum limit of 500 resources, and I ...

Cancelling a lengthy external API request within a Vercel serverless function

My Vercel serverless function includes a request to an external API using node fetch. To prevent it from running for too long, I am planning to set a timeout of one second for aborting the external request if it exceeds this threshold. Do you think this i ...

Embrace the flexibility of using Next.js with or without Express.js

Recently, I started the process of migrating a project from create-react-app to next.js. However, I am facing uncertainty when it comes to migrating the backend of the project. Currently, my backend is built with an express server. In next.js, there are p ...

AWS Lambda serverless deployment of Angular Universal is failing to detect javascript files in the dist/browser directory

After following the steps in this tutorial for deploying to a lambda function, I encountered some issues. When testing it using serverless offline, I kept getting 404 errors for each compiled JS file. However, once I deployed it, the errors changed to 403. ...

The CORS policy has blocked the AWS API Gateway request originating from 'http://localhost:8080'

Currently, I am facing an issue with deploying an API for use in Front End. The API functions properly when tested alone, but it returns a CORS error when integrated into a Vue app. The specific error message is as follows: Access to XMLHttpRequest at &a ...

Getting a return value from a post request in NextJs 9 Serverless: a step-by-step guide

I am currently working on a serverless application using NextJs but I have hit a roadblock when trying to retrieve a user's JWT in the return value after making a post request to my database. While everything else seems to be functioning correctly, th ...

Is there a way to retrieve the value of an option passed by serverless CLI in serverless.ts file?

As I explored the serverless framework with serverless.ts for configuration, a certain question came to mind. When utilizing the serverless CLI, passing values can be done in the following way: serverless offline --stage prod In the serverless.yml file, ...

How can the request object be obtained in a Node.js lambda function using Serverless Websockets?

Connecting my client application to the Websocket server using the URL: wss://xxxxxxx/xxxxx/xxxx?value=abcd The WebSocket server I'm working on needs to retrieve the value "abcd" that is passed by the client in the request URL. However, all I can find in ...

Executing a serverless function in Next.js using getStaticPaths: A step-by-step guide

In my current project, I am utilizing Next.js and the Vercel deployment workflow. To set up page generation at build time, I have been following a guide that demonstrates how to generate pages based on an external API's response. // At build time, t ...

Deliver a personalized error notification using serverless-http (express) framework

I am trying to send a custom error message in JSON format from my express app, which is served in a lambda function using serverless-http To achieve this, it seems I need to utilize LAMBDA_PROXY APIG integration to enable sending custom error messages dir ...

Manage and modify a singular variable using Vercel serverless functions

Working with a client on a static website project using Next.js and hosted on Vercel. The site doesn't require a database, but the client wants to integrate an Instagram gallery on two pages. However, the design is custom, so embedding code won't ...

The error message thrown by DynamoDB BatchGet is always 'The key element supplied does not align with the schema'

I've been struggling with the DynamoDB batchGet operation for quite some time now. Here's my table definition using serverless: Resources: MyTable: Type: AWS::DynamoDB::Table DeletionPolicy: Retain Properties: TableName: MyTab ...

How are the number of Zeit serverless functions determined?

After migrating my Nextjs project to the Zeit platform and setting up the environment, I encountered deployment issues. The configuration is basic: { "version": 2, "name": "<....>", "alias": "<...>", "routes": [ { "src": "^/service ...

Encountering an error when importing fs into a Next.js serverless function

While working in Next.js 14, I encountered an issue when trying to import 'fs' inside a serverless function: import fs from "fs"; import path from 'path'; export async function POST(req: Request) { const promptTemplate = fs.readFileSync(path ...

Unlocking Node.js packages within React JS is a seamless process

Currently, I am developing a React Serverless App with AWS. I am looking for ways to incorporate a Node JS specific package into the React JS code without requiring Node JS on the backend. One package that I need access to is font-list, which enables list ...

Developing a Python serverless function on Vercel using Next.js is a streamlined

Discovering the capability of using Python to create a serverless function within a Next.js project was truly exciting. Once deployed on Vercel, it seamlessly transforms into a serverless function. Browsing through the documentation, I stumbled upon a str ...

Utilizing AWS Amplify with TypeScript and TypeScript Lambdas for powerful web development

Currently, I am working on a project that involves a nextjs frontend with TypeScript and AWS Amplify for the backend. My intention is to write my Lambda functions in TypeScript as well. However, I have encountered an issue where I have one tsconfig.json fi ...

Switching from utilizing apollo-server-micro to upgrading to apollo server 4

While it may seem like a simple task, I'm having trouble understanding the documentation for migrating to Apollo Server 4. My current setup involves using Next.js as a framework without Express, and I'm aiming for a serverless architecture. Belo ...

Is there a way to place a Next.js application into maintenance mode on Vercel?

After successfully launching my nextjs application on Vercel, I've been thoroughly impressed with the overall process. However, there is one minor aspect that I wish could be improved: the ability to easily activate a maintenance mode for my app. Unf ...

The recently launched AWS Amplify application (serverless) is encountering a 403 Access Denied error

So I've gone ahead and created a brand new serverless (lambda) app using nodejs, expressjs, and ejs on AWS Amplify. After deploying it to the server using auto deployment, I tried accessing my app through the following URL: master.<...>.amplifya ...