Skip to content

Instantly share code, notes, and snippets.

View Mr-Malomz's full-sized avatar

Demola Malomo Mr-Malomz

  • Lagos, Nigeria
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Mr-Malomz
Mr-Malomz / React Template
Created February 19, 2019 09:29
React Template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Tweet Box</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
@Mr-Malomz
Mr-Malomz / nest_new_project
Last active August 16, 2020 11:40
Scaffold new Nestjs Project
nest new auth-nestjs && cd auth-nestjs
nest g module auth
@Mr-Malomz
Mr-Malomz / auth.module.ts
Created August 20, 2020 21:57
auth module
import { Module } from '@nestjs/common';
@Module({})
export class AuthModule {}
@Mr-Malomz
Mr-Malomz / app.module.ts
Created August 20, 2020 22:09
App module (Root module of our application)
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AuthModule } from './auth/auth.module';
@Module({
imports: [AuthModule],
controllers: [AppController],
providers: [AppService],
})
@Mr-Malomz
Mr-Malomz / nest controller and service
Created August 20, 2020 22:27
Scaffold controller and service
nest g controller auth && nest g service auth
@Mr-Malomz
Mr-Malomz / nest_db
Created August 20, 2020 23:39
DB dependencies
npm i @nestjs/typeorm typeorm pg
@Mr-Malomz
Mr-Malomz / typeorm.config.ts
Last active August 21, 2020 00:20
TypeORM Configuration
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
export const typeOrmConfig: TypeOrmModuleOptions = {
type: 'postgres',
host: 'localhost',
port: 5432,
username: 'postgres',
password: 'postgres',
database: 'authuser',
entities: [__dirname + '/../**/*.entity{.ts,.js}'],
@Mr-Malomz
Mr-Malomz / app.module.ts
Created August 26, 2020 23:00
Updated ap.module.ts
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AuthModule } from './auth/auth.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { typeOrmConfig } from './config/typeorm.config';
@Module({
// Updated imports to finailize configuration
imports: [TypeOrmModule.forRoot(typeOrmConfig), AuthModule],