next.js
846b46fd - Add --api Flag to Create Headless API App with create-next-app (#68130)

Commit
1 year ago
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 <arindammajumder2020@gmail.com> Co-authored-by: Mert Can Altin <mertgold60@gmail.com> Co-authored-by: Jiwon Choi <devjiwonchoi@gmail.com> Co-authored-by: Tim_Z <z22zhong@uwaterloo.ca> Co-authored-by: Tim_Z <43297139+Tim-Zj@users.noreply.github.com> Co-authored-by: Ahmed Abdelbaset <A7med3bdulBaset@gmail.com> Co-authored-by: Lee Robinson <me@leerob.io> Co-authored-by: Ephraim Atta-Duncan <ephraimduncan68@gmail.com> Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
Author
Parents
Loading