-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.ts
More file actions
36 lines (28 loc) · 848 Bytes
/
Copy pathserver.ts
File metadata and controls
36 lines (28 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
let express = require('express');
let app = express();
const path = require('path');
let rootPath = path.normaize(__dirname + '/dist/')
let port = process.env.PORT || 4200;
let fs = require('fs');
let filename = rootPath + 'assets/appconfig.json'
let file = require(filename);
file.serviceBaseUrl = process.env.BUILDER_API_URL || '';
fs.writeFile()
*/
import 'reflect-metadata';
import 'zone.js/dist/zone-node';
import { enableProdMode } from '@angular/core'
import * as express from 'express';
import { readFileSync } from 'fs';
import { join } from 'path';
const PORT = 8084;
enableProdMode();
const app = express();
app.get('*.*', express.static(join(__dirname, '..', 'dist')));
app.get('*', (req, res) => {
res.render('index', { req });
});
app.listen(PORT, () => {
console.log(`listening on http://104.211.229.17:${PORT}!`);
});