Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Zeit Vercel Serverless Functions Examples

Prerequisites

Instructions

Note: Right now this example does not use the local source files in the serverless functions inside api/ since, at the time of this writing, vercel dev does not support symlinked packages or local dependencies.

  1. Install the latest version of the main package as a dep to this example:
    yarn add netlify-cms-oauth-provider-node@latest
  2. Create a .env file in this directory with the following contents, filling in OAUTH_CLIENT_ID and OAUTH_CLIENT_SECRET with your GitHub OAuth app's ID and secret. Also ensure that your GitHub OAuth app's callback URL matches COMPLETE_URL.
    DEBUG=netlify-cms-oauth-provider-node*
    COMPLETE_URL=http://localhost:3000/api/complete
    OAUTH_CLIENT_ID=
    OAUTH_CLIENT_SECRET=
    NODE_ENV=development
    OAUTH_PROVIDER=github
    ORIGIN=localhost:3000
    
  3. If you've forked this repository, update config.yml with your repo. Otherwise you will be in a read-only mode OR the login will fail since you (probably) won't have write access to this package's repository.
  4. Run the dev server:
    yarn start
  5. Visit the local dev server at (likely) http://localhost:3000