Building Endpoints

Creating an Endpoint

  1. 1.
    Click on the + Create a new endpoint button
  2. 2.
    Give your Endpoint a name and description
  3. 3.
    Select the method type
  4. 4.
    Click Create
Creating an endpoint in the dashboard
Voilà! In a matter of seconds, you’ve created an almost infinitely scaleable endpoint powered by Buildable's fully managed infrastructure.

Customizing the Endpoint's Cloud Function

Once your endpoint is live and you've set the method type [1], you can begin customizing the execution code. Code is written in the blazing-fast editor [5] found in the Code tab and receives 3 values as arguments:
  1. 1.
    body - The Request Body Object
  2. 2.
    headers - The Request Headers Object
  3. 3.
    env - Your Environment Variables Object
All of your logic should be written in the response method and can only be done in the endpoint's Development Environment [9]. Your code must return the following object at the end to set the Endpoint’s response details:
async function response({ body, headers, env }) {
// Your logic here
return {
status: 200, // HTTP Response Status Code
headers: {}, // Response Headers
// Response Body
body: {
message: "Hello World ⚡️",
To populate the code editor [5] with example snippets, select an available option from the Snippets List [6].

Using NPM Packages

In Buildable, NPM packages are installed as usual. For a list of supported NPM packages: