mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
add convex
This commit is contained in:
5
apps/cli/templates/backend/server/next/next-env.d.ts
vendored
Normal file
5
apps/cli/templates/backend/server/next/next-env.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||
7
apps/cli/templates/backend/server/next/next.config.ts
Normal file
7
apps/cli/templates/backend/server/next/next.config.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
/* config options here */
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
18
apps/cli/templates/backend/server/next/package.json
Normal file
18
apps/cli/templates/backend/server/next/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "server",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
"build": "next build",
|
||||
"start": "next start"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "15.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
"typescript": "^5"
|
||||
}
|
||||
}
|
||||
5
apps/cli/templates/backend/server/next/src/app/route.ts
Normal file
5
apps/cli/templates/backend/server/next/src/app/route.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET() {
|
||||
return NextResponse.json({ message: "OK" });
|
||||
}
|
||||
19
apps/cli/templates/backend/server/next/src/middleware.ts
Normal file
19
apps/cli/templates/backend/server/next/src/middleware.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export function middleware() {
|
||||
const res = NextResponse.next()
|
||||
|
||||
res.headers.append('Access-Control-Allow-Credentials', "true")
|
||||
res.headers.append('Access-Control-Allow-Origin', process.env.CORS_ORIGIN || "")
|
||||
res.headers.append('Access-Control-Allow-Methods', 'GET,POST,OPTIONS')
|
||||
res.headers.append(
|
||||
'Access-Control-Allow-Headers',
|
||||
'Content-Type, Authorization'
|
||||
)
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
export const config = {
|
||||
matcher: '/:path*',
|
||||
}
|
||||
27
apps/cli/templates/backend/server/next/tsconfig.json
Normal file
27
apps/cli/templates/backend/server/next/tsconfig.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2017",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"plugins": [
|
||||
{
|
||||
"name": "next"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user