This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.js
. The page auto-updates as you edit the file.
API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.js
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
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.
As a programming expert, perform the following steps before making changes to existing code or adding features:
1.Code Lookup: 1.1.Start by carefully searching the existing code base to see if a code module, function, or tool class already exists that is similar to the target function or logic. 1.2.Use a code search tool (e.g. grep, ripgrep, or the IDE's built-in search function) to find relevant logic based on keywords. 1.3.Verify that this existing code meets the current requirements or can be extended and optimized to avoid duplication of development.
2.Compare functionality: 2.1.If similar code modules are found, analyze their inputs, outputs, functional logic, and dependencies. 2.2.Compare whether they can be reused or modified appropriately without breaking the existing logic. 2.3.Document the relevant code found as a basis for analysis and decision making.
3.Code reuse: 3.1.If there is existing functionality that can be reused, prioritize reuse over developing from scratch. 3.2.If there are deficiencies in the existing code, the functionality can be extended on the original basis rather than creating new modules.
4.Modification Principle: 4.1.Ensure that new code modifications do not create duplication or redundancy. 4.2.Optimize the code structure to improve maintainability and readability. If new code needs to be written, design it as a general-purpose module so that it can be reused for other subsequent functions. 4.3.Only after completing the above steps can you continue to make code changes or develop new features. Finally, please add comments after the code modification is completed, stating the functional intent, the reason for the change, and whether the modification is based on an existing code module.