Quick Start

Build your first Fleet function the same way you do with Node.js and known frameworks, nothing changes!

This guide helps you quickly get into the serverless ecosystem, install the CLI and implement a simple HTTP function in your project.

Initial Setup

Before you begin it is important that you install the Fleet CLI and have a Fleet account to implement your function.

Create and deploy a serverless function

Now that you have completed your setup, let's create and deploy a Serverless function faster.

mkdir http-endpoint && cd http-endpoint

Once you have a folder for your project we will create the fleet.yml file which is where you tell Fleet where your functions and settings are.

functions:
  myFirstFunction:
    handler: "function.js",
    http:
      method: ["GET"]
      path: "/"

We can now create our function in function.js.

export default (req, res) => res.send({message: 'ƒ Fleet Function!'});

Initialize from an example

Start your first function from an example using the Fleet CLI, try to run it from your command line:

fleet init

or start directly from an example:

fleet init graphql-api

Deploy Function

Use the CLI to make deployments every time you want to send to production or simply create a new preview endpoint that can be shared with your team.

fleet

Test your Function

Replace the URL in the following curl command with your returned endpoint URL, which you find in the output of the fleet command.

curl -X GET https://xxxxx-xxxxxxxxx.runfleet.io/