diff --git a/examples/api/app/api/hello/route.js b/examples/api/app/api/hello/route.ts similarity index 70% rename from examples/api/app/api/hello/route.js rename to examples/api/app/api/hello/route.ts index aebcdfc76..b4028c87f 100644 --- a/examples/api/app/api/hello/route.js +++ b/examples/api/app/api/hello/route.ts @@ -6,3 +6,7 @@ export async function GET() { const sayHi = !!headersList.get("should-say-hi"); return new Response(sayHi ? "Hi World!" : "Hello World!"); } + +export async function POST(request: Request) { + return new Response(`Hello post-World! body=${await request.text()}`); +} diff --git a/examples/api/tsconfig.json b/examples/api/tsconfig.json new file mode 100644 index 000000000..174c9f3c8 --- /dev/null +++ b/examples/api/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": false, + "noEmit": true, + "incremental": true, + "module": "esnext", + "esModuleInterop": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "plugins": [ + { + "name": "next" + } + ] + }, + "include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +}