data.tablename.get

Get a row by key

Example:

@app
testapp

@http
get /

@tables
notes
  noteID *String

And then in a Lambda function:

// src/html/get-index/index.js
let arc = require('@architect/functions')
let data = require('@architect/data')

async function handler(req, res) {
  let noteID = req.query.noteID
  let note = await data.notes.get({noteID})
  res({
    html: note.body
  })
}

exports.handler = arc.http(handler)

Next: query