Deploy your mocks in serverless environments

Mockoon Serverless package takes your mock APIs in cloud functions and serverless environments. Easy to use, lightweight and fast.

Mockoon Serverless screenshot

Mockoon's perfect complement for cloud functions and serverless environments.

Supports all Mockoon's features

Our Serverless library supports all of Mockoon's features: dynamic templating, response rules, proxy mode, etc.

View all features

Lightweight and fast

Deploy lighting fast mock servers in your serverless environment with a simple and easy-to-use NPM package.

How to use it

Compatible with most providers

Deploy a cloud function compatible with any provider: AWS Lambda, GCP Functions, Firebase Functions, etc.

See code samples

NPM package installation

Copy
$ npm install @mockoon/serverless

AWS Lambda quick start

Copy
const mockoon = require('@mockoon/serverless'); const mockEnv = require('./mockoon-datafile.json'); const mockoonServerless = new mockoon.MockoonServerless(mockEnv); module.exports.handler = mockoonServerless.awsHandler();

Firebase Functions quick start

Copy
import * as functions from 'firebase-functions'; import { MockoonServerless } from '@mockoon/serverless'; const mockEnv = require('./mockoon-datafile.json'); const app = new MockoonServerless(mockEnv); exports.app = functions.https.onRequest(app);