update docs and scripts
This commit is contained in:
parent
2aeba61e73
commit
a06ffff107
8 changed files with 20 additions and 8 deletions
|
|
@ -252,15 +252,15 @@ Lets rock and roll.
|
|||
{
|
||||
"name": "netlify-fauna",
|
||||
"scripts": {
|
||||
"ABOUT-bootstrap-command": "#👇 scaffold and setup FaunaDB #",
|
||||
"👇 ABOUT-bootstrap-command": "💡 scaffold and setup FaunaDB #",
|
||||
"bootstrap": "node ./scripts/bootstrap-fauna-database.js",
|
||||
"ABOUT-start-command": "#👇 start the app and server #",
|
||||
"👇 ABOUT-start-command": "💡 start the app and server #",
|
||||
"start": "npm-run-all --parallel start:app start:server",
|
||||
"start:app": "react-scripts start",
|
||||
"start:server": "netlify-lambda serve functions -c ./webpack.config.js",
|
||||
"ABOUT-prebuild-command": "#👇 before 'build' runs, run the 'bootstrap' command #",
|
||||
"👇 ABOUT-prebuild-command": "💡 before 'build' runs, run the 'bootstrap' command #",
|
||||
"prebuild": "echo 'setup faunaDB' && npm run bootstrap",
|
||||
"ABOUT-build-command": "#👇 build the react app and the serverless functions #",
|
||||
"👇 ABOUT-build-command": "💡 build the react app and the serverless functions #",
|
||||
"build": "npm-run-all --parallel build:**",
|
||||
"build:app": "react-scripts build",
|
||||
"build:functions": "netlify-lambda build functions -c ./webpack.config.js",
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* Import faunaDB sdk */
|
||||
import faunadb from 'faunadb'
|
||||
|
||||
const q = faunadb.query
|
||||
|
|
@ -8,7 +9,11 @@ const client = new faunadb.Client({
|
|||
exports.handler = (event, context, callback) => {
|
||||
const data = JSON.parse(event.body)
|
||||
console.log("Function `todo-create` invoked", data)
|
||||
return client.query(q.Create(q.Ref("classes/todos"), {data}))
|
||||
const todoItem = {
|
||||
data: data
|
||||
}
|
||||
/* construct the fauna query */
|
||||
return client.query(q.Create(q.Ref("classes/todos"), todoItem))
|
||||
.then((response) => {
|
||||
console.log("success", response)
|
||||
return callback(null, {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* Import faunaDB sdk */
|
||||
import faunadb from 'faunadb'
|
||||
import getId from './utils/getId'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* Import faunaDB sdk */
|
||||
import faunadb from 'faunadb'
|
||||
import getId from './utils/getId'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* Import faunaDB sdk */
|
||||
import faunadb from 'faunadb'
|
||||
|
||||
const q = faunadb.query
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* Import faunaDB sdk */
|
||||
import faunadb from 'faunadb'
|
||||
import getId from './utils/getId'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* Import faunaDB sdk */
|
||||
import faunadb from 'faunadb'
|
||||
import getId from './utils/getId'
|
||||
|
||||
|
|
|
|||
|
|
@ -10,10 +10,11 @@
|
|||
},
|
||||
"scripts": {
|
||||
"bootstrap": "node ./scripts/bootstrap-fauna-database.js",
|
||||
"docs": "md-magic --path '**/*.md' --ignore 'node_modules'",
|
||||
"checkForFaunaKey": "node ./scripts/check-for-fauna-key.js",
|
||||
"start": "npm-run-all --parallel checkForFaunaKey startApp startServer",
|
||||
"startApp": "react-scripts start",
|
||||
"startServer": "netlify-lambda serve functions -c ./webpack.config.js",
|
||||
"start": "npm-run-all --parallel checkForFaunaKey start:app start:server",
|
||||
"start:app": "react-scripts start",
|
||||
"start:server": "netlify-lambda serve functions -c ./webpack.config.js",
|
||||
"prebuild": "echo 'setup faunaDB' && npm run bootstrap",
|
||||
"build": "npm-run-all --parallel build:**",
|
||||
"build:app": "react-scripts build",
|
||||
|
|
@ -21,6 +22,7 @@
|
|||
"test": "react-scripts test --env=jsdom"
|
||||
},
|
||||
"devDependencies": {
|
||||
"markdown-magic": "^0.1.22",
|
||||
"netlify-lambda": "^0.4.0",
|
||||
"npm-run-all": "^4.1.3"
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue