Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
jitendraashutec committed Dec 19, 2019
1 parent b9ca9e7 commit 260510b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "functions",
"description": "Cloud Functions for Firebase",
"engines": {
"node": "8"
"node": "10"
},
"dependencies": {
"body-parser": "1.19.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"angular2-cookie-law": "^7.0.1",
"axios": "^0.19.0",
"dom-to-image": "^2.6.0",
"firebase": "^6.4.0",
"firebase": "^7.6.1",
"firebaseui": "^4.1.0",
"google-libphonenumber": "^3.2.5",
"hammerjs": "^2.0.8",
Expand Down
3 changes: 3 additions & 0 deletions projects/trivia/tsconfig.server.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"./src/**/*.tns.ts",
"./src**/*.android.ts",
"./src/**/*.ios.ts",
"**/*.tns.ts",
"**/*.android.ts",
"**/*.ios.ts",
"./src/main.ns.aot.ts",
"./src/main.ns.ts",
"./src/vendor.ts",
Expand Down
18 changes: 9 additions & 9 deletions server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,24 @@ import * as compression from 'compression';
import { XMLHttpRequest } from 'xmlhttprequest';
import { join } from 'path';


const win = domino.createWindow('');


global['window'] = win;
global['window']['JSON'] = JSON;
global['window']['Promise'] = Promise;
global['document'] = win.document;
global['Node'] = win['Node'];
global['navigator'] = win.navigator;
global['XMLHttpRequest'] = XMLHttpRequest;


global['componentHandler'] = {
register: () => {}
}
const app = express();

// console.log(process.cwd());
const DIST_FOLDER = join(process.cwd(), './dist/browser');
// console.log(DIST_FOLDER);


const {
AppServerModuleNgFactory,
LAZY_MODULE_MAP,
Expand All @@ -46,14 +44,16 @@ app.set('view engine', 'html');
app.set('views', DIST_FOLDER);
app.use(compression());

app.get('*.*', express.static(DIST_FOLDER, {
maxAge: '1y'
}));
app.get(
'*.*',
express.static(DIST_FOLDER, {
maxAge: '1y'
})
);

// Point all routes to Universal
app.get('*', (req, res) => {
res.render('index', { req });
});

export default app;

0 comments on commit 260510b

Please sign in to comment.