Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 1.4 KB

README.md

File metadata and controls

49 lines (36 loc) · 1.4 KB

Hacker News reader using Next.js

License: MIT Twitter Follow

Demo GIF

Statically dynamic using ISR

With Next.js' Incremental Static Regeneration (ISR), dynamic content can be statically served. Existing pages can be updated once a request is made.

Inspired by Brian Lovin's work. Check it out here!

Development

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

Configuration

You can change the regeneration frequency by changing the revalidate value.

export async function getStaticProps(context) {
  const posts = await getPosts();
  const data = posts.filter(Boolean)

  return {
    props: {
      data,
    },
    revalidate: 3600,
  };
}

You can also change the number of posts displayed by passing an integer to getPosts.

Author

License

This project is open source and available under the MIT License