Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2021
What would you like to do?
Entry point for Serverless Strapi with serverless-http
const startStrapi = require("strapi/lib/Strapi");
const serverless = require("serverless-http");
module.exports.handler = async (event, context) => {
if (!global.strapi) {
console.log("Cold starting Strapi");
await startStrapi({ dir: __dirname }).start();
const handler = serverless(;
return handler(event, context);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment