HelloWorld
The simplest VextJS project to help you understand the basic structure and working of the framework.
Complete project structure
1. Initialize project
Use the vext create scaffolding to quickly create:
Or create manually:
2. Configuration file
package.json
tsconfig.json
3. Configuration
adapter: 'native' uses the built-in Native Adapter (based on http.createServer + route-core), with zero external HTTP framework dependencies and the highest performance. You can also switch to 'hono', 'fastify', 'express' or 'koa' without any changes to the business code**.
4. Routing
5. Entry file
6. Run
Development mode
Development mode features:- Automatic hot reloading of file modifications (three-layer strategy: routing/service/configuration smart refresh)
- Beautify log output (built-in pretty format)
- Automatically enable OpenAPI documentation (visit
http://localhost:3000/docs)
Production mode
7. Verification
After startup, you can use curl or browser verification:
8. Response format description
VextJS enables export wrapping by default (config.response.wrap: true), and all res.json() responses will be automatically wrapped into a unified format:
Successful response:
Error response:
If packaging is not required (e.g. inter-microservice communication), it can be disabled in the configuration:
Key concepts review
Next step
- 📖 Read Quick Start to learn more about the complete project construction process
- 📖 Read CRUD API Examples to learn about database integration
- 📖 Read Project Structure to understand the convention directory specification
- 📖 Read Routing to learn more about the three-stage routing definition