jlengstorf / frontendmasters-serverless

Source code for the Serverless workshop on Frontend Masters.

Home Page:https://frontendmasters.com/courses/serverless-functions/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frontend Masters: Serverless Functions with Jason Lengstorf

This is the source code for a Frontend Masters course with Jason Lengstorf about serverless functions.

Live site! https://frontendmasters-serverless.netlify.app/

The Major Things We’ll Learn in This Workshop

  1. What does “serverless” mean?
  2. How to load data using serverless functions
  3. How to protect private credentials in front-end applications
  4. How to send data to serverless functions
  5. How to save data sent to serverless functions
  6. How to limit access to serverless functions

Get Started

Node version: v12.12.0

# currently v2.58.0
npm install -g netlify-cli@latest
# or use HTTPS if you have issues cloning
git clone --branch start https://github.com/jlengstorf/frontendmasters-serverless.git

Get Environment Variables:

Save all of these in .env:

Make sure to install dotenv npm install dotenv and add require("dotenv").config() to each file that uses one of the environment variables.

Resources

Using Hasura & Heroku to create a secret Admin Key:

  • Create a Hasura account, and link it to a Heroku account.

  • Go to Settings on your Heroku account, and add config vars HASURA_ADMIN_SECRET and HASURA_GRAPHQL_ADMIN_SECRET. Config Var Heroku

  • On Hasura, once you create a new project, add a new env var, Admin Secret, by clicking on New Env Var, and name it Admin Secret. Config Var Hasura

  • Launch the Hasura console and make sure that your GraphQL endpoint is no longer public. GraphQL Endpoint

License

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

About

Source code for the Serverless workshop on Frontend Masters.

https://frontendmasters.com/courses/serverless-functions/


Languages

Language:HTML 57.8%Language:JavaScript 33.3%Language:CSS 6.5%Language:Liquid 2.4%