This file contains hidden or 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
| import { Entity, Column, ObjectIdColumn } from 'typeorm'; | |
| @Entity() | |
| export class User { | |
| @ObjectIdColumn() | |
| _id: string; | |
| @Column() | |
| username: string; | |
| @Column() | |
| password: string; |
This file contains hidden or 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
| import { Module } from '@nestjs/common'; | |
| import { AppController } from './app.controller'; | |
| import { AppService } from './app.service'; | |
| import { GraphQLModule } from '@nestjs/graphql'; | |
| import { UserModule } from './user/user.module'; | |
| import { TypeOrmModule } from '@nestjs/typeorm'; | |
| import { join } from 'path'; | |
| @Module({ | |
| imports: [ |
This file contains hidden or 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
| type User { | |
| _id: String! | |
| username: String! | |
| password: String! | |
| } | |
| input UserInput { | |
| username: String! | |
| password: String! | |
| } |
This file contains hidden or 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
| import { Module } from '@nestjs/common'; | |
| import { AppController } from './app.controller'; | |
| import { AppService } from './app.service'; | |
| import { GraphQLModule } from '@nestjs/graphql'; | |
| import { join } from 'path'; | |
| @Module({ | |
| imports: [ | |
| GraphQLModule.forRoot({ | |
| typePaths: ['./**/*.graphql'], |
This file contains hidden or 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
Show hidden characters
| { | |
| "compilerOptions": { | |
| "module": "commonjs", | |
| "declaration": true, | |
| "removeComments": true, | |
| "emitDecoratorMetadata": true, | |
| "experimentalDecorators": true, | |
| "target": "es6", | |
| "sourceMap": true, | |
| "outDir": "./dist", |
This file contains hidden or 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
| import { NestFactory } from '@nestjs/core'; | |
| import { AppModule } from './app.module'; | |
| import { Logger } from '@nestjs/common'; | |
| const port = process.env.PORT || 3000; | |
| async function bootstrap() { | |
| const app = await NestFactory.create(AppModule); | |
| await app.listen(port); | |
| Logger.log(`🚀 Server running on http://localhost:${port}`, 'Bootstrap'); |
NewerOlder