Documentation

Database

db.save(key, value): persist data

db.get(key): get saved data (need to include .data to get the data)

Query params

query.param: eg query.person

Requests

requests.get("url"): GET data from api


Example 1

const personId = query.person;

const personData = (await requests.get("https://swapi.dev/api/people/" + personId)).data

await db.save(personId, personData)

return await db.get(personId)


example 2

let current = (await db.get("counter")).value || 0;

await db.save("counter",{value:current+1})

return current + 1;


Create function

Function link: https://api.built.so/run/functionName?person=1

Function name:

Function code: