-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from tiagoluizpoli/develop
added vercel token as github secret
- Loading branch information
Showing
18 changed files
with
724 additions
and
5,281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const GET = async () => { | ||
return new Response( | ||
JSON.stringify({ route: '/api', message: 'Hello World' }), | ||
{ | ||
status: 200, | ||
}, | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { todoController } from '@/server/controller'; | ||
export const GET = async (request: Request) => { | ||
return await todoController.get(request); | ||
}; | ||
|
||
export const POST = async (request: Request) => { | ||
return await todoController.create(request); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import StyledJsxRegistry from './registry'; | ||
export const metadata = { | ||
title: 'Next.js', | ||
description: 'Generated by Next.js', | ||
}; | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<html lang='en'> | ||
<body> | ||
<StyledJsxRegistry>{children}</StyledJsxRegistry> | ||
</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use client'; | ||
|
||
import React, { useState } from 'react'; | ||
import { useServerInsertedHTML } from 'next/navigation'; | ||
import { StyleRegistry, createStyleRegistry } from 'styled-jsx'; | ||
|
||
export default function StyledJsxRegistry({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
// Only create stylesheet once with lazy initial state | ||
// x-ref: https://reactjs.org/docs/hooks-reference.html#lazy-initial-state | ||
const [jsxStyleRegistry] = useState(() => createStyleRegistry()); | ||
|
||
useServerInsertedHTML(() => { | ||
const styles = jsxStyleRegistry.styles(); | ||
jsxStyleRegistry.flush(); | ||
return <>{styles}</>; | ||
}); | ||
|
||
return <StyleRegistry registry={jsxStyleRegistry}>{children}</StyleRegistry>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { PrismaClient } from '@prisma/client'; | ||
|
||
const prismaClientSingleton = () => { | ||
return new PrismaClient(); | ||
}; | ||
|
||
type PrismaClientSingleton = ReturnType<typeof prismaClientSingleton>; | ||
|
||
const globalForPrisma = globalThis as unknown as { | ||
prisma: PrismaClientSingleton | undefined; | ||
}; | ||
|
||
const prisma = globalForPrisma.prisma ?? prismaClientSingleton(); | ||
|
||
export default prisma; | ||
|
||
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
/// <reference types="next/navigation-types/compat/navigation" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module.exports = { | ||
reactStrictMode: true, | ||
reactStrictMode: true, | ||
}; |
Oops, something went wrong.