imp(core): http.listener files reorganization
MODIFY
packages/core/src/index.ts
packages/core/src/index.ts
@@ -13,4 +13,4 @@ export * from './event/event.interface';
export * from './server/server.injector';
export * from './server/server.event';
export { createServer, CreateServerConfig } from './server/server.factory';
-export { HttpListenerConfig, httpListener } from './http.listener';
+export { HttpListenerConfig, httpListener } from './listener/http.listener';

RENAME
packages/core/src/http.listener.spec.ts
packages/core/src/listener/http.listener.spec.ts
@@ -2,8 +2,8 @@ import { IncomingMessage, OutgoingMessage } from 'http';
import { of, throwError } from 'rxjs';
import { mapTo, switchMap } from 'rxjs/operators';
import { httpListener } from './http.listener';
-import { EffectFactory } from './effects/effects.factory';
-import { Middleware } from './effects/effects.interface';
+import { EffectFactory } from '../effects/effects.factory';
+import { Middleware } from '../effects/effects.interface';
describe('Http listener', () => {
let effectsCombiner;
@@ -19,16 +19,16 @@ describe('Http listener', () => {
const middleware$: Middleware = req$ => req$;
beforeEach(() => {
- jest.unmock('./error/error.effect.ts');
- jest.unmock('./effects/effects.combiner.ts');
- jest.unmock('./response/response.handler.ts');
- jest.unmock('./router/router.factory.ts');
- jest.unmock('./router/router.resolver.ts');
-
- effectsCombiner = require('./effects/effects.combiner.ts');
- responseHandler = require('./response/response.handler.ts');
- routerFactory = require('./router/router.factory.ts');
- routerResolver = require('./router/router.resolver.ts');
+ jest.unmock('../error/error.effect.ts');
+ jest.unmock('../effects/effects.combiner.ts');
+ jest.unmock('../response/response.handler.ts');
+ jest.unmock('../router/router.factory.ts');
+ jest.unmock('../router/router.resolver.ts');
+
+ effectsCombiner = require('../effects/effects.combiner.ts');
+ responseHandler = require('../response/response.handler.ts');
+ routerFactory = require('../router/router.factory.ts');
+ routerResolver = require('../router/router.resolver.ts');
});
test('#httpListener handles received HttpRequest', done => {

RENAME
packages/core/src/http.listener.ts
packages/core/src/listener/http.listener.ts
import { IncomingMessage, OutgoingMessage } from 'http';
import { of, Subject } from 'rxjs';
import { catchError, defaultIfEmpty, mergeMap, switchMap, tap, takeWhile } from 'rxjs/operators';
-import { combineMiddlewares } from './effects/effects.combiner';
-import { EffectHttpResponse, Middleware, ErrorEffect } from './effects/effects.interface';
-import { Http, HttpRequest, HttpResponse, HttpStatus } from './http.interface';
-import { handleResponse } from './response/response.handler';
-import { RouteEffect, RouteEffectGroup } from './router/router.interface';
-import { resolveRouting } from './router/router.resolver';
-import { factorizeRouting } from './router/router.factory';
-import { defaultError$ } from './error/error.effect';
-import { createStaticInjectionContainer } from './server/server.injector';
+import { combineMiddlewares } from '../effects/effects.combiner';
+import { EffectHttpResponse, Middleware, ErrorEffect } from '../effects/effects.interface';
+import { Http, HttpRequest, HttpResponse, HttpStatus } from '../http.interface';
+import { handleResponse } from '../response/response.handler';
+import { RouteEffect, RouteEffectGroup } from '../router/router.interface';
+import { resolveRouting } from '../router/router.resolver';
+import { factorizeRouting } from '../router/router.factory';
+import { defaultError$ } from '../error/error.effect';
+import { createStaticInjectionContainer } from '../server/server.injector';
export interface HttpListenerConfig {
middlewares?: Middleware[];

MODIFY
packages/core/src/server/server.factory.ts
packages/core/src/server/server.factory.ts
import * as http from 'http';
import { takeWhile } from 'rxjs/operators';
-import { httpListener } from '../http.listener';
+import { httpListener } from '../listener/http.listener';
import { isCloseEvent } from './server.event';
import { subscribeServerEvents } from './server.event.subscriber';
import { InjectionDependencies } from './server.injector';

MODIFY
packages/core/src/server/specs/server.factory.spec.ts
packages/core/src/server/specs/server.factory.spec.ts
import { forkJoin } from 'rxjs';
import { mapTo, tap, filter, take } from 'rxjs/operators';
-import { httpListener } from '../../http.listener';
+import { httpListener } from '../../listener/http.listener';
import { createServer } from '../server.factory';
import {
ServerEventType,

imp(core): http.listener files reorganization