added mongod module + created schema file
This commit is contained in:
parent
4b7d4d9022
commit
9d3e39683c
2 changed files with 15 additions and 3 deletions
|
@ -2,13 +2,17 @@ import { Module } from '@nestjs/common';
|
||||||
import { MongoModule } from 'nest-mongodb'
|
import { MongoModule } from 'nest-mongodb'
|
||||||
import { ApiModule } from './api/api.module';
|
import { ApiModule } from './api/api.module';
|
||||||
import { CrawlerModule } from './crawler/crawler.module';
|
import { CrawlerModule } from './crawler/crawler.module';
|
||||||
|
const dotenv = require('dotenv');
|
||||||
// import { DbModule } from './db/db.module';
|
// import { DbModule } from './db/db.module';
|
||||||
import dotenv from 'dotenv';
|
|
||||||
|
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
|
console.log(process)
|
||||||
@Module({
|
@Module({
|
||||||
imports: [ApiModule, CrawlerModule, MongoModule.forRoot('mongodb://localhost', process.env.DB_NAME)]
|
imports: [
|
||||||
|
MongoModule.forRoot(process.env.DB_URI, process.env.DB_NAME),
|
||||||
|
ApiModule,
|
||||||
|
CrawlerModule
|
||||||
|
]
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule { }
|
||||||
|
|
8
src/db/schema/mydatabase.schema.ts
Normal file
8
src/db/schema/mydatabase.schema.ts
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { ObjectId } from 'mongodb';
|
||||||
|
|
||||||
|
export interface Cat {
|
||||||
|
_id: ObjectId;
|
||||||
|
domain: string;
|
||||||
|
cssSheetsLocation: string[];
|
||||||
|
scriptsSheetsLocation: string[];
|
||||||
|
}
|
Loading…
Reference in a new issue