jlengstorf / Frontendmasters Serverless
Projects that are alternatives of or similar to Frontendmasters Serverless
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/
See details
The Major Things We’ll Learn in This Workshop
- What does “serverless” mean?
- How to load data using serverless functions
- How to protect private credentials in front-end applications
- How to send data to serverless functions
- How to save data sent to serverless functions
- How to limit access to serverless functions
Get Started
Node version: v12.12.0
# currently v2.58.0
npm install -g [email protected]
# 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
:
-
OMDB_API_KEY
— get this from https://omdbapi.com/ -
HASURA_API_URL
— get this from https://hasura.io/ -
HASURA_ADMIN_SECRET
— get this from https://hasura.io/
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.
-
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.
-
Launch the Hasura console and make sure that your GraphQL endpoint is no longer public.
License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.