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

1.4 KiB

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/route.ts. The page auto-updates as you edit the file.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

API Routes

This directory contains example API routes for the headless API app.

For more details, see route.js file convention.