Files
846b46fde0 Add --api Flag to Create Headless API App with create-next-app (#68130)
### What?

Added a new option for `create-next-app` to create a headless API app.
This includes:
- Adding a `--api` flag for `create-next-app` to create a headless app.
- Modifying the template to include only the required assets (no
`public/`, `app/page.*`, etc.).
- Ensuring the app includes only the required dependencies (no
`@types/react`, `react`, etc.).

### Why?

This feature allows users to initialize projects with headless API
templates, making it easier to set up projects that require backend
functionality without frontend components.

### How?

- Added the `--api` flag to the `create-next-app` command.
- Modified the template to exclude unnecessary assets and dependencies.
- Included exemplary usage of `route.js` features with comments for user
guidance.
- Implemented HTTP Methods and Parameters for request validation.

Closes #68118
Closes NEXT-3633
Closes NDX-120

---------

Signed-off-by: Arindam Majumder <[email protected]>
Co-authored-by: Mert Can Altin <[email protected]>
Co-authored-by: Jiwon Choi <[email protected]>
Co-authored-by: Tim_Z <[email protected]>
Co-authored-by: Tim_Z <[email protected]>
Co-authored-by: Ahmed Abdelbaset <[email protected]>
Co-authored-by: Lee Robinson <[email protected]>
Co-authored-by: Ephraim Atta-Duncan <[email protected]>
Co-authored-by: Zack Tanner <[email protected]>
2025-01-10 03:20:58 +00:00

41 lines
437 B
Plaintext

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env*.local
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts