Skip to content

Instantly share code, notes, and snippets.

@fatfingererr
Created December 6, 2022 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatfingererr/0eea14546a7d6a1977e5920ebe4e7352 to your computer and use it in GitHub Desktop.
Save fatfingererr/0eea14546a7d6a1977e5920ebe4e7352 to your computer and use it in GitHub Desktop.
FlureeDBQuery.js
require("dotenv").config()
const fetch = require("node-fetch")
const ledger = process.env.FLUREE_DEFAULT_LEDGER
const param = JSON.stringify({
select: ["*", {"sysuser": ["*"]}],
from: "user"
})
let headers = {
"Content-Type": "application/json",
Authorization: "Bearer " + process.env.FLUREE_TOKEN
}
const fullURI = `${process.env.FLUREE_BASE_URL}/fdb/${ledger}/query`
fetch(fullURI, { method: "POST", headers: headers, body: param }).then(
async (response) => {
const body = await response.text()
console.log(body)
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment