Created
December 6, 2022 14:55
-
-
Save fatfingererr/0eea14546a7d6a1977e5920ebe4e7352 to your computer and use it in GitHub Desktop.
FlureeDBQuery.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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