# LMS-NodeJs 一个基于NestJS框架的图书管理系统后端API。 ## 环境配置 在项目根目录创建 `.env` 文件,添加以下配置: ```env # 服务器配置 SERVER_URL=http://localhost:3000 FILE_PATH=./uploads PORT=3000 # 数据库配置 DB_HOST=localhost DB_PORT=3306 DB_USERNAME=root DB_PASSWORD=123456 DB_DATABASE=books # 其他配置 NODE_ENV=development ``` ## 环境变量说明 - `SERVER_URL`: 服务器地址,用于生成文件访问URL(默认:http://localhost:3000) - `FILE_PATH`: 文件存储路径(默认:./uploads) - `PORT`: 服务器端口(默认:3000) - `DB_HOST`: 数据库主机地址 - `DB_PORT`: 数据库端口 - `DB_USERNAME`: 数据库用户名 - `DB_PASSWORD`: 数据库密码 - `DB_DATABASE`: 数据库名称 ## 功能特性 - **文件管理**: 支持文件上传、下载和去重 - **图书管理**: 完整的图书CRUD操作 - **作者管理**: 作者信息管理 - **标签管理**: 标签分类管理 - **章节管理**: 图书章节管理 - **热门管理**: 热门内容管理 - **辅助功能**: 辅助工具管理 - **行管理**: 文本行管理 ## 文件上传功能 ### 上传文件 ```bash curl -X POST http://localhost:3000/file/upload -F "file=@test.jpg" ``` ### 访问文件 ```bash curl -X GET http://localhost:3000/file/download/[fileId] ``` 或在浏览器中访问:`http://localhost:3000/file/download/[fileId]` ---
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 [circleci-url]: https://circleci.com/gh/nestjs/nestA progressive Node.js framework for building efficient and scalable server-side applications.
## Description [Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. ## Project setup ```bash $ pnpm install ``` ## Compile and run the project ```bash # development $ pnpm run start # watch mode $ pnpm run start:dev # production mode $ pnpm run start:prod ``` ## Run tests ```bash # unit tests $ pnpm run test # e2e tests $ pnpm run test:e2e # test coverage $ pnpm run test:cov ``` ## Deployment When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information. If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps: ```bash $ pnpm install -g @nestjs/mau $ mau deploy ``` With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure. ## Resources Check out a few resources that may come in handy when working with NestJS: - Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework. - For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy). - To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/). - Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks. - Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com). - Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com). - To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs). - Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com). ## Support Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). ## Stay in touch - Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec) - Website - [https://nestjs.com](https://nestjs.com/) - Twitter - [@nestframework](https://twitter.com/nestframework) ## License Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE). https://www.cnblogs.com/bluecobra/archive/2012/01/11/2318922.html