fixing node_modules/@types/cookie-parser errors | correcting previous wrong commit for file app.module.ts

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@48850 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2017-08-29 12:16:21 +00:00
parent 55db83bae2
commit caa07034a4
7 changed files with 26 additions and 58 deletions

View File

@ -102,11 +102,8 @@ app.use(interceptor((req, res)=>({
} }
} else { } else {
const { output, encoding } = mcache.get(key); const { output, encoding } = mcache.get(key);
if(encodings.has(encoding)){ res.setHeader('Content-Encoding', encoding);
res.setHeader('Content-Encoding', encoding); send(output);
send(output);
return;
}
} }
send(output); send(output);
} }

View File

@ -77,7 +77,7 @@
"@types/morgan": "^1.7.32", "@types/morgan": "^1.7.32",
"@types/body-parser": "0.0.29", "@types/body-parser": "0.0.29",
"@types/compression": "0.0.29", "@types/compression": "0.0.29",
"@types/cookie-parser": "^1.3.29", "@types/cookie-parser": "1.3.30",
"@types/express": "^4.0.32", "@types/express": "^4.0.32",
"@types/express-serve-static-core": "^4.0.33", "@types/express-serve-static-core": "^4.0.33",
"@types/hammerjs": "^2.0.32", "@types/hammerjs": "^2.0.32",

View File

@ -5,7 +5,7 @@ import { Component, Directive, ElementRef, Renderer, ChangeDetectionStrategy, Vi
// ** Example Directive // ** Example Directive
// Notice we don't touch the Element directly // Notice we don't touch the Element directly
@Directive({ /*@Directive({
selector: '[xLarge]' selector: '[xLarge]'
}) })
export class XLargeDirective { export class XLargeDirective {
@ -17,7 +17,7 @@ export class XLargeDirective {
// ^^ // ^^
} }
} }
*/
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.Default, changeDetection: ChangeDetectionStrategy.Default,
encapsulation: ViewEncapsulation.Emulated, encapsulation: ViewEncapsulation.Emulated,

View File

@ -1,4 +1,8 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SharedModule } from './shared/shared.module';
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
@ -9,7 +13,7 @@ import { CookieLawModule } from './sharedComponents/cookie-law/cookie-law.module
import { XSRFStrategy, CookieXSRFStrategy, RequestOptions } from '@angular/http'; import { XSRFStrategy, CookieXSRFStrategy, RequestOptions } from '@angular/http';
@NgModule({ @NgModule({
declarations: [ AppComponent, XLargeDirective ], declarations: [ AppComponent ],
imports: [ imports: [
SharedModule, SharedModule,

View File

@ -76,30 +76,16 @@ import { serverApi, createTodoApi } from './backend/api';
app.get('/data.json', serverApi); app.get('/data.json', serverApi);
app.use('/api', createTodoApi()); app.use('/api', createTodoApi());
process.on('uncaughtException', function (err) {
console.error('Catching uncaught errors to avoid process crash', err);
});
function ngApp(req, res) { function ngApp(req, res) {
res.render('index', {
function onHandleError(parentZoneDelegate, currentZone, targetZone, error) { req,
console.warn('Error in SSR, serving for direct CSR'); res,
res.sendFile('index.html', {root: './src'}); // time: true, // use this to determine what part of your app is slow only in development
return false; preboot: false,
} baseUrl: '/',
requestUrl: req.originalUrl,
Zone.current.fork({ name: 'CSR fallback', onHandleError }).run(() => { originUrl: `http://localhost:${ app.get('port') }`
res.render('index', {
req,
res,
// time: true, // use this to determine what part of your app is slow only in development
preboot: false,
baseUrl: '/',
requestUrl: req.originalUrl,
originUrl: `http://localhost:${ app.get('port') }`
});
}); });
} }
/** /**

View File

@ -69,30 +69,16 @@ import { serverApi, createTodoApi } from './backend/api';
app.get('/data.json', serverApi); app.get('/data.json', serverApi);
app.use('/api', createTodoApi()); app.use('/api', createTodoApi());
process.on('uncaughtException', function (err) {
console.error('Catching uncaught errors to avoid process crash', err);
});
function ngApp(req, res) { function ngApp(req, res) {
res.render('index', {
function onHandleError(parentZoneDelegate, currentZone, targetZone, error) { req,
console.warn('Error in SSR, serving for direct CSR'); res,
res.sendFile('index.html', {root: './src'}); // time: true, // use this to determine what part of your app is slow only in development
return false; preboot: false,
} baseUrl: '/',
requestUrl: req.originalUrl,
Zone.current.fork({ name: 'CSR fallback', onHandleError }).run(() => { originUrl: `http://localhost:${ app.get('port') }`
res.render('index', {
req,
res,
// time: true, // use this to determine what part of your app is slow only in development
preboot: false,
baseUrl: '/',
requestUrl: req.originalUrl,
originUrl: `http://localhost:${ app.get('port') }`
});
}); });
} }
/** /**

View File

@ -31,10 +31,6 @@ declare module 'modern-lru' {
export = x; export = x;
} }
//declare var clipboard: any;
//import * as Clipboard from 'clipboard';
declare var System: SystemJS; declare var System: SystemJS;
interface SystemJS { interface SystemJS {
@ -44,7 +40,6 @@ interface SystemJS {
declare var ENV: string; declare var ENV: string;
declare var HMR: boolean; declare var HMR: boolean;
declare var Zone: {current: any}; declare var Zone: {current: any};
interface GlobalEnvironment { interface GlobalEnvironment {
ENV; ENV;
HMR; HMR;