Coder Social home page Coder Social logo

on-demand-isr's Introduction

Deploy with Vercel

On-Demand Incremental Static Regeneration

Demo of on-demand ISR in Next.js 12.1 using GitHub Issues. When a new issue is created, a webhook from a GitHub App pushes new changes to the deployed application to regenerate the static page.

Setup

  1. Create a new GitHub App
    1. Provide the URL of your deployed application for Homepage URL
    2. Ensure Webhook "Active" is checked
    3. Add <your-site>/api/webhook as the Webhook URL
    4. Create a Webhook secret and add it to .env.local as GITHUB_WEBHOOK_SECRET
    5. Give "Read Only" access to Issues
    6. Subscribe to "Issues" events
  2. Add the App ID to .env.local as GITHUB_APP_ID
  3. Generate a private key and add it to .env.local as GITHUB_APP_PK_PEM
  4. Install the newly created GitHub App for your repo
  5. https://github.com/settings/apps/<your-app-name>/installations

Running Locally

$ npm run dev

Learn More

on-demand-isr's People

Contributors

arshkkk avatar ctgowrie avatar leerob avatar rauchg avatar steven-tey avatar ycjcl868 avatar

on-demand-isr's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.