generated from moevm/nsql-clean-tempate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from moevm/db-module
Add neo4j module
- Loading branch information
Showing
17 changed files
with
199 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules/ | ||
dist/ | ||
Dockerfile | ||
.dockerignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import { Controller, Get } from '@nestjs/common'; | ||
import { AppService } from './app.service'; | ||
import {Controller, Get} from '@nestjs/common'; | ||
|
||
@Controller() | ||
export class AppController { | ||
constructor(private readonly appService: AppService) {} | ||
|
||
@Get() | ||
getHello(): string { | ||
return this.appService.getHello(); | ||
} | ||
@Get("/hello") | ||
getHello() { | ||
return "Hello World!"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { ConfigModule, ConfigService } from '@nestjs/config'; | ||
import { AppController } from './app.controller'; | ||
import { AppService } from './app.service'; | ||
import { Neo4jModule } from 'nest-neo4j' | ||
import { Neo4jModule } from './modules/neo4j/neo4j.module'; | ||
import { Neo4jConfig } from './modules/neo4j/neo4j-config.interface'; | ||
|
||
@Module({ | ||
imports: [ | ||
Neo4jModule.forRoot({ | ||
scheme: 'neo4j', | ||
host: 'localhost', | ||
port: 7687, | ||
username: 'neo4j', | ||
password: 'neo' | ||
}) | ||
ConfigModule.forRoot({}), | ||
Neo4jModule.forRootAsync({ | ||
imports: [ConfigModule], | ||
inject: [ConfigService], | ||
useFactory: (configService: ConfigService): Neo4jConfig => ({ | ||
scheme: configService.get('NEO4J_SCHEME'), | ||
host: configService.get('NEO4J_HOST'), | ||
port: configService.get('NEO4J_PORT'), | ||
username: configService.get('NEO4J_USERNAME'), | ||
password: configService.get('NEO4J_PASSWORD'), | ||
database: configService.get('NEO4J_DB'), | ||
}), | ||
}), | ||
], | ||
controllers: [AppController], | ||
providers: [AppService], | ||
providers: [], | ||
}) | ||
export class AppModule {} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface Neo4jConfig { | ||
scheme: string; | ||
host: string; | ||
port: number | string; | ||
username: string; | ||
password: string; | ||
database?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const NEO4J_CONFIG = 'NEO4J_CONGIG'; | ||
export const NEO4J_DRIVER = 'NEO4J_DRIVER'; |
Oops, something went wrong.