https://github.com/slaveofcode/poc-nestjs-modular-typeorm
https://github.com/slaveofcode/poc-nestjs-modular-typeorm
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/slaveofcode/poc-nestjs-modular-typeorm
- Owner: slaveofcode
- Created: 2022-03-21T18:25:30.000Z (almost 4 years ago)
- Default Branch: develop
- Last Pushed: 2022-03-22T04:07:36.000Z (almost 4 years ago)
- Last Synced: 2025-01-20T15:23:36.291Z (about 1 year ago)
- Language: TypeScript
- Size: 154 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# POC of Modular NestJs Project Using Typeorm
## Step
#### Create empty database
Create new database, then configure these related entity for database connection
1. go to `main-project/src/app.module.ts` to update database connection for **example** module.
2. create file `main-project/.env`, based on `.env.example` to update database connection for **main-project** module
#### Build or Running Example Module
1. `cd example`
2. `npm i`
3. `npm run build` or `npm run start:dev` to generate `dist` sources
#### Include & Running Example from Main Project
1. `cd main-project`
2. `npm i`
3. `npm i ../example`
4. `npm run start:dev` to run the server
## Test
#### Call module "example" from "main-project"
```curl
curl http://localhost:3000/todo
```
#### Call service from "example" module (if you running it as a server too)
```curl
curl http://localhost:6000/todo
```