fauna

node v10.24.1
version: 1.0.1
endpointsharetweet
const express = require("express") const app = express() const faunadb = require("faunadb") const q = faunadb.query const client = new faunadb.Client({ secret: process.env.FAUNA_SECRET }) app.get("/", (req, res) => { client.ping() .then(ret => res.send(JSON.stringify(ret, null, 2))) .catch(err => res.send(err.message)) }) app.get('/fauna', (req, res) => { client.query( q.Paginate(q.Match(q.Index("all_customers"))) ) .then(ret => res.send(ret.data[0])) .catch(err => res.send(err.message)) }) app.listen(8080)
Loading…

no comments

    sign in to comment