Skip to content

Commit 405b469

Browse files
committed
Updates with typescript and adds API routes
1 parent f9663e9 commit 405b469

16 files changed

+2023
-3311
lines changed

lib/prisma.js renamed to lib/prisma.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { PrismaClient } from '@prisma/client';
22

3-
let prisma;
3+
let prisma: PrismaClient;
4+
5+
declare global {
6+
var prisma: PrismaClient;
7+
}
48

59
if (process.env.NODE_ENV === 'production') {
610
prisma = new PrismaClient();
@@ -11,4 +15,4 @@ if (process.env.NODE_ENV === 'production') {
1115
prisma = global.prisma;
1216
}
1317

14-
export default prisma;
18+
export default prisma;

next-env.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

next.config.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
module.exports = {
1+
/** @type {import('next').NextConfig} */
2+
const nextConfig = {
23
reactStrictMode: true,
3-
}
4+
swcMinify: true,
5+
};
6+
7+
module.exports = nextConfig;

0 commit comments

Comments
 (0)