Skip to content

Commit

Permalink
docs(@nestjs) initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Nov 18, 2017
1 parent 312fb9c commit 44f25c8
Show file tree
Hide file tree
Showing 111 changed files with 3,154 additions and 377 deletions.
15 changes: 15 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
RewriteEngine On
RewriteBase /

#if the request is not secure
RewriteCond %{HTTPS} off
#redirect to the secure version
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]

#These are your existing rules
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

RewriteRule ^(.*) /index.html [NC,L]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.2.3",
"@angular/cli": "^1.5.0",
"@angular/compiler-cli": "^4.0.0",
"@angular/language-service": "^4.0.0",
"@types/jasmine": "~2.5.53",
Expand Down
59 changes: 59 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ import { GlobalPrefixComponent } from './homepage/pages/faq/global-prefix/global
import { LifecycleEventsComponent } from './homepage/pages/faq/lifecycle-events/lifecycle-events.component';
import { HybridApplicationComponent } from './homepage/pages/faq/hybrid-application/hybrid-application.component';
import { MultipleServersComponent } from './homepage/pages/faq/multiple-servers/multiple-servers.component';
import { MongodbComponent } from './homepage/pages/recipes/mongodb/mongodb.component';
import { SqlSequelizeComponent } from './homepage/pages/recipes/sql-sequelize/sql-sequelize.component';
import { PassportComponent } from './homepage/pages/recipes/passport/passport.component';
import { CqrsComponent } from './homepage/pages/recipes/cqrs/cqrs.component';

const routes: Routes = [
{
Expand All @@ -52,142 +56,197 @@ const routes: Routes = [
{
path: 'first-steps',
component: FirstStepsComponent,
data: { title: 'First Steps' },
},
{
path: 'controllers',
component: ControllersComponent,
data: { title: 'Controllers' },
},
{
path: 'components',
component: ComponentsComponent,
data: { title: 'Components' },
},
{
path: 'modules',
component: ModulesComponent,
data: { title: 'Modules' },
},
{
path: 'middlewares',
component: MiddlewaresComponent,
data: { title: 'Middlewares' },
},
{
path: 'pipes',
component: PipesComponent,
data: { title: 'Pipes' },
},
{
path: 'guards',
component: GuardsComponent,
data: { title: 'Guards' },
},
{
path: 'exception-filters',
component: ExceptionFiltersComponent,
data: { title: 'Exception Filters' },
},
{
path: 'interceptors',
component: InterceptorsComponent,
data: { title: 'Interceptors' },
},
{
path: 'advanced/dependency-injection',
component: DependencyInjectionComponent,
data: { title: 'Dependency Injection' },
},
{
path: 'advanced/async-components',
component: AsyncComponentsComponent,
data: { title: 'Async Components' },
},
{
path: 'advanced/mixins',
component: MixinComponentsComponent,
data: { title: 'Mixin Class' },
},
{
path: 'advanced/hierarchical-injector',
component: HierarchicalInjectorComponent,
data: { title: 'Hierarchical Injector' },
},
{
path: 'advanced/circular-dependency',
component: CircularDependencyComponent,
data: { title: 'Circular Dependency' },
},
{
path: 'advanced/unit-testing',
component: UnitTestingComponent,
data: { title: 'Unit Testing' },
},
{
path: 'advanced/e2e-testing',
component: E2eTestingComponent,
data: { title: 'E2E Testing' },
},
{
path: 'websockets/gateways',
component: GatewaysComponent,
data: { title: 'Gateways' },
},
{
path: 'websockets/pipes',
component: WsPipesComponent,
data: { title: 'Pipes - Gateways' },
},
{
path: 'websockets/exception-filters',
component: WsExceptionFiltersComponent,
data: { title: 'Exception Filters - Gateways' },
},
{
path: 'websockets/guards',
component: WsGuardsComponent,
data: { title: 'Guards - Gateways' },
},
{
path: 'websockets/interceptors',
component: WsInterceptorsComponent,
data: { title: 'Interceptors - Gateways' },
},
{
path: 'websockets/adapter',
component: AdapterComponent,
data: { title: 'Adapter - Gateways' },
},
{
path: 'microservices/basics',
component: BasicsComponent,
data: { title: 'Microservices' },
},
{
path: 'microservices/redis',
component: RedisComponent,
data: { title: 'Redis - Microservices' },
},
{
path: 'microservices/pipes',
component: MicroservicesPipesComponent,
data: { title: 'Pipes - Microservices' },
},
{
path: 'microservices/exception-filters',
component: MicroservicesExceptionFiltersComponent,
data: { title: 'Exception Filters - Microservices' },
},
{
path: 'microservices/guards',
component: MicroservicesGuardsComponent,
data: { title: 'Guards - Microservices' },
},
{
path: 'microservices/interceptors',
component: MicroservicesInterceptorsComponent,
data: { title: 'Interceptors - Microservices' },
},
{
path: 'microservices/custom-transport',
component: CustomTransportComponent,
data: { title: 'Custom Transport - Microservices' },
},
{
path: 'recipes/sql-typeorm',
component: SqlTypeormComponent,
data: { title: 'SQL (TypeORM)' },
},
{
path: 'recipes/mongodb',
component: MongodbComponent,
data: { title: 'MongoDB (Mongoose)' },
},
{
path: 'recipes/passport',
component: PassportComponent,
data: { title: 'Passport integration' },
},
{
path: 'recipes/sql-sequelize',
component: SqlSequelizeComponent,
data: { title: 'SQL (Sequelize)' },
},
{
path: 'recipes/cqrs',
component: CqrsComponent,
data: { title: 'CQRS' },
},
{
path: 'faq/express-instance',
component: ExpressInstanceComponent,
data: { title: 'Express Instance - FAQ' },
},
{
path: 'faq/global-prefix',
component: GlobalPrefixComponent,
data: { title: 'Global Prefix - FAQ' },
},
{
path: 'faq/lifecycle-events',
component: LifecycleEventsComponent,
data: { title: 'Lifecycle Events - FAQ' },
},
{
path: 'faq/hybrid-application',
component: HybridApplicationComponent,
data: { title: 'Hybrid Application - FAQ' },
},
{
path: 'faq/multiple-servers',
component: MultipleServersComponent,
data: { title: 'HTTPS & Multiple Servers - FAQ' },
},
]
},
Expand Down
32 changes: 0 additions & 32 deletions src/app/app.component.spec.ts

This file was deleted.

27 changes: 24 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
import { Title } from '@angular/platform-browser';

import { TITLE_SUFFIX, HOMEPAGE_TITLE } from './constants';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AppComponent implements OnInit {
constructor(private readonly router: Router) { }
constructor(
private readonly titleService: Title,
private readonly router: Router,
private readonly activatedRoute: ActivatedRoute) {}

ngOnInit() {
this.router.events
.filter((ev) => ev instanceof NavigationEnd)
.subscribe(() => window.scroll(0, 0));
.subscribe((ev) => {
window.scroll(0, 0);
this.updateTitle();
});
}

updateTitle() {
const route = this.activatedRoute.snapshot.firstChild;
if (!route) {
return undefined;
}
const childRoute = route.firstChild;
const { data: { title } } = childRoute;
const pageTitle = title ? title : HOMEPAGE_TITLE;

this.titleService.setTitle(pageTitle + TITLE_SUFFIX);
}
}
16 changes: 14 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { CoreModule } from './core/core.module';
import { HomepageComponent } from './homepage/homepage.component';
import { HeaderComponent } from './homepage/header/header.component';
import { FooterComponent } from './homepage/footer/footer.component';
Expand Down Expand Up @@ -48,12 +47,18 @@ import { MultipleServersComponent } from './homepage/pages/faq/multiple-servers/
import { HierarchicalInjectorComponent } from './homepage/pages/advanced/hierarchical-injector/hierarchical-injector.component';
import { SqlTypeormComponent } from './homepage/pages/recipes/sql-typeorm/sql-typeorm.component';
import { MixinComponentsComponent } from './homepage/pages/advanced/mixin-components/mixin-components.component';
import { SqlSequelizeComponent } from './homepage/pages/recipes/sql-sequelize/sql-sequelize.component';
import { MongodbComponent } from './homepage/pages/recipes/mongodb/mongodb.component';
import { PassportComponent } from './homepage/pages/recipes/passport/passport.component';
import { SwaggerComponent } from './homepage/pages/recipes/swagger/swagger.component';
import { CqrsComponent } from './homepage/pages/recipes/cqrs/cqrs.component';
import { TabsComponent } from './shared/components/tabs/tabs.component';
import { ExtensionPipe } from './shared/pipes/extension.pipe';

@NgModule({
imports: [
BrowserModule,
AppRoutingModule,
CoreModule,
PerfectScrollbarModule.forRoot({
suppressScrollX: true,
}),
Expand Down Expand Up @@ -103,6 +108,13 @@ import { MixinComponentsComponent } from './homepage/pages/advanced/mixin-compon
HierarchicalInjectorComponent,
SqlTypeormComponent,
MixinComponentsComponent,
SqlSequelizeComponent,
MongodbComponent,
PassportComponent,
SwaggerComponent,
CqrsComponent,
TabsComponent,
ExtensionPipe,
],
bootstrap: [AppComponent]
})
Expand Down
2 changes: 2 additions & 0 deletions src/app/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const HOMEPAGE_TITLE = 'Documentation';
export const TITLE_SUFFIX = ' | Nest - A progressive Node.js web framework';
6 changes: 0 additions & 6 deletions src/app/core/config/config.service.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/app/core/config/dev-config.service.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/app/core/config/prod-config.service.ts

This file was deleted.

Loading

0 comments on commit 44f25c8

Please sign in to comment.