Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sampoder/prisma-day-2021
🖍 An introduction workshop to Prisma & Next.js for Prisma Day 2021
https://github.com/sampoder/prisma-day-2021
nextjs prisma workshop
Last synced: 12 days ago
JSON representation
🖍 An introduction workshop to Prisma & Next.js for Prisma Day 2021
- Host: GitHub
- URL: https://github.com/sampoder/prisma-day-2021
- Owner: sampoder
- Created: 2021-06-03T11:49:49.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-07-19T06:20:04.000Z (over 3 years ago)
- Last Synced: 2024-05-01T16:29:41.263Z (6 months ago)
- Topics: nextjs, prisma, workshop
- Homepage: https://www.youtube.com/watch?v=61iu_7Zdmus
- Size: 37.3 MB
- Stars: 27
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Prisma, Next.js & ISR: Building Speedy Web Apps
> Static Site Generation & Server Side Rendering each have an extensive list of benefits, what if we could combine them? Meet Incremental Static Regeneration and Next.js. In this talk we'll go over what ISR is, the benefits of ISR and how we can use Next.js' ISR with Prisma as well as why we should use it with Prisma. Best of all, we'll be exploring a practical application of Next.js, ISR & Prisma. After this lightning talk, your web pages will be faster than the speed of light.
I gave this talk at [Prisma Day 2021](https://www.prisma.io/day), the recording is available [here](https://www.youtube.com/watch?v=61iu_7Zdmus).
Some handy code samples are:
```javascript
export async function getStaticPaths() {
const { getUsers } = require('./api/users')
let users = await getUsers(300)
let paths = users.map(user => ({
params: { username: user.name },
}))
return { paths, fallback: true }
}
``````javascript
export async function getStaticProps({ params }) {
const { getRedemptions } = require(‘./api/[username]’)
let initalRedemptions = await getRedemptions(params.username)
return {
props: { initalRedemptions, username: params.username },
revalidate: 30
}
}
```
More information is in the [slides](https://github.com/sampoder/prisma-nextjs/tree/main/slides).