A NodeJS API for FaunaDB
// api.js
const FaunaAPI = require("@osirisx3r0/faunadb-node-api");
module.exports = new FaunaAPI(process.env.FAUNA_API_KEY);
// users.js
const API = require("api.js");
const getUsers = async () => {
await API.connect();
return await API.users.getAll();
};
-
Clone the repository
-
Create a
config.js
file at the project rootmodule.exports = { FAUNA_ADMIN_KEY: "A9OP84HAE4598ES45GSAE9P458GE9GH8095GPS98", };