Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ileostar/nest-three-wheel-api
前端三轮项目接口
https://github.com/ileostar/nest-three-wheel-api
nestjs practice-project typeorm vercel-serverless
Last synced: 2 months ago
JSON representation
前端三轮项目接口
- Host: GitHub
- URL: https://github.com/ileostar/nest-three-wheel-api
- Owner: ileostar
- Created: 2023-10-15T08:01:53.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-08T15:13:11.000Z (about 1 year ago)
- Last Synced: 2024-10-12T00:33:30.660Z (3 months ago)
- Topics: nestjs, practice-project, typeorm, vercel-serverless
- Language: TypeScript
- Homepage:
- Size: 590 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
## 项目描述
该项目是一个练手项目,使用[Nest](https://github.com/nestjs/nest)框架进行编写,这里因为采用的是serveless服务形式,使用的是vercel服务+远程数据库(阿里云/腾讯云数据库/[ElephantSQL
](https://www.elephantsql.com/))的形式部署## 安装
```bash
pnpm install
```## 更换数据库
在`src/config/configurations.ts`下面更换数据库信息
这里使用了TypeORM,如果远程数据库没有这个表会自动创建,
但是得先要创建一个空的数据库```typescript
function loadConfig() {
return {
db: {
database: 'three-wheel', // <-----必须先创建空的数据库three-wheel(也可以改成新的数据库名)
// ...more
},
}
}
```## 运行
```bash
# development
$ pnpm run start# watch mode
$ pnpm run start:dev# production mode
$ pnpm run start:prod
```## 测试
```bash
# unit tests
$ pnpm run test# e2e tests
$ pnpm run test:e2e# test coverage
$ pnpm run test:cov
```export default loadConfig
## 部署
```bash
# 登陆vercel
$ vercel login# 部署到vercel
$ pnpm vercel
```