Skip to content

karlyanelson/random-psalm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random Psalm

Gets a random Psalm from the ESV API using Netlify Functions

View Website

Development

  1. Install Netlify CLI globally so you can use netlify-dev

  2. You should be logged in on Netlify CLI

  3. Your project should be linked to a siteID on Netlify (using netlify init or netlify link). You can confirm this has been done if you have a .netlify folder with a state.json file containing your siteID.

  4. run npm install to get node-fetch which you'll need to fetch things inside your function

  5. add your api key to your netlify environmental variables in the netlify settings ui (your site > site settings > build & deploy > environmental variables)

  6. create a functions/ folder at the root and put your {FUNCTION NAME}.js file there

  7. add netlify.toml pointing to functions/ folder

  8. run netlify dev to have a local server and be able to access functions

    • view your site at http://localhost:8888
    • the functions will be accessible at http://localhost:8888/.netlify/functions/function-name.

Resources

Netlify Functions Docs

netlify-dev Docs

Basic function calling an api with javascript and node-fetch (this is the example you get when you run netlify functions:create and choose node-fetch)

About

random psalm generator using the ESV api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published