This repository was archived by the owner on Sep 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 10 files changed +6423
-20370
lines changed Expand file tree Collapse file tree 10 files changed +6423
-20370
lines changed Original file line number Diff line number Diff line change 11/* Import faunaDB sdk */
22const faunadb = require ( 'faunadb' )
3-
4- /* configure faunaDB Client with our secret */
53const q = faunadb . query
6- const client = new faunadb . Client ( {
7- secret : process . env . FAUNADB_SERVER_SECRET
8- } )
94
105/* export our lambda function as named "handler" export */
116exports . handler = async ( event , context ) => {
7+ /* configure faunaDB Client with our secret */
8+ const client = new faunadb . Client ( {
9+ secret : process . env . FAUNADB_SERVER_SECRET
10+ } )
1211 /* parse the string body into a useable JS object */
1312 const data = JSON . parse ( event . body )
1413 console . log ( 'Function `todo-create` invoked' , data )
Original file line number Diff line number Diff line change 11/* Import faunaDB sdk */
22const faunadb = require ( 'faunadb' )
3-
43const q = faunadb . query
5- const client = new faunadb . Client ( {
6- secret : process . env . FAUNADB_SERVER_SECRET
7- } )
84
95exports . handler = async ( event , context ) => {
6+ /* configure faunaDB Client with our secret */
7+ const client = new faunadb . Client ( {
8+ secret : process . env . FAUNADB_SERVER_SECRET
9+ } )
1010 const data = JSON . parse ( event . body )
1111 console . log ( 'data' , data )
1212 console . log ( 'Function `todo-delete-batch` invoked' , data . ids )
Original file line number Diff line number Diff line change 11/* Import faunaDB sdk */
22const faunadb = require ( 'faunadb' )
33const getId = require ( './utils/getId' )
4-
54const q = faunadb . query
6- const client = new faunadb . Client ( {
7- secret : process . env . FAUNADB_SERVER_SECRET
8- } )
5+
96
107exports . handler = async ( event , context ) => {
8+ /* configure faunaDB Client with our secret */
9+ const client = new faunadb . Client ( {
10+ secret : process . env . FAUNADB_SERVER_SECRET
11+ } )
1112 const id = getId ( event . path )
1213 console . log ( `Function 'todo-delete' invoked. delete id: ${ id } ` )
1314 return client . query ( q . Delete ( q . Ref ( `classes/todos/${ id } ` ) ) )
Original file line number Diff line number Diff line change 11/* Import faunaDB sdk */
22const faunadb = require ( 'faunadb' )
3-
43const q = faunadb . query
5- const client = new faunadb . Client ( {
6- secret : process . env . FAUNADB_SERVER_SECRET
7- } )
4+
85
96exports . handler = ( event , context ) => {
107 console . log ( 'Function `todo-read-all` invoked' )
8+ /* configure faunaDB Client with our secret */
9+ const client = new faunadb . Client ( {
10+ secret : process . env . FAUNADB_SERVER_SECRET
11+ } )
1112 return client . query ( q . Paginate ( q . Match ( q . Ref ( 'indexes/all_todos' ) ) ) )
1213 . then ( ( response ) => {
1314 const todoRefs = response . data
Original file line number Diff line number Diff line change 11/* Import faunaDB sdk */
22const faunadb = require ( 'faunadb' )
33const getId = require ( './utils/getId' )
4-
54const q = faunadb . query
6- const client = new faunadb . Client ( {
7- secret : process . env . FAUNADB_SERVER_SECRET
8- } )
95
106exports . handler = ( event , context ) => {
7+ /* configure faunaDB Client with our secret */
8+ const client = new faunadb . Client ( {
9+ secret : process . env . FAUNADB_SERVER_SECRET
10+ } )
1111 const id = getId ( event . path )
1212 console . log ( `Function 'todo-read' invoked. Read id: ${ id } ` )
1313 return client . query ( q . Get ( q . Ref ( `classes/todos/${ id } ` ) ) )
Original file line number Diff line number Diff line change 11const faunadb = require ( 'faunadb' )
22const getId = require ( './utils/getId' )
3-
43const q = faunadb . query
5- const client = new faunadb . Client ( {
6- secret : process . env . FAUNADB_SERVER_SECRET
7- } )
84
95exports . handler = ( event , context ) => {
6+ /* configure faunaDB Client with our secret */
7+ const client = new faunadb . Client ( {
8+ secret : process . env . FAUNADB_SERVER_SECRET
9+ } )
1010 const data = JSON . parse ( event . body )
1111 const id = getId ( event . path )
1212 console . log ( `Function 'todo-update' invoked. update id: ${ id } ` )
You can’t perform that action at this time.
0 commit comments