Uvacoder / hn-feeds

Home Page:https://hn-feeds.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

https://hn-feeds.vercel.app

License:MIT License


Languages

Language:JavaScript 97.9%Language:CSS 2.1%