Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add headless api template #68138

Open
wants to merge 3 commits into
base: canary
Choose a base branch
from

Conversation

ephraimduncan
Copy link
Contributor

What?

This PR introduces a new feature to create-next-app that allows users to create a headless API-only Next.js application.

Why?

To provide developers with a streamlined option for creating API-only Next.js applications without the frontend components, which is useful for building backend services or microservices.

How?

The changes include:

  1. Adding a new --api flag to the create-next-app CLI options.
  2. Creating new template files for both JavaScript and TypeScript versions of the headless API application.
  3. Modifying the create-app logic to handle the new API-only option.

Key changes:

  • New headless-api template type added
  • api flag added to CLI options and relevant functions
  • New template files for API-only apps in both JS and TS
  • Logic to exclude React and other frontend-related dependencies for API-only apps

This PR implements a new feature request for creating API-only Next.js applications using create-next-app.

Fixes #68118

@ijjk ijjk added the create-next-app Related to our CLI tool for quickly starting a new Next.js application. label Jul 25, 2024
@ijjk
Copy link
Member

ijjk commented Jul 25, 2024

Allow CI Workflow Run

  • approve CI run for commit: 400c87e

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@ephraimduncan ephraimduncan changed the title feat: add headless api template Add headless api template Jul 25, 2024
@devjiwonchoi
Copy link
Member

Thank you for your work @ephraimduncan!
As mentioned on #68118, could you migrate yours to #68130? 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create-next-app Related to our CLI tool for quickly starting a new Next.js application.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option for create-next-app to create a headless API app.
3 participants