Initial config with a few files that build on client and server side.

This commit is contained in:
Dmitry S
2020-05-20 00:50:46 -04:00
commit ec182792be
20 changed files with 4762 additions and 0 deletions

24
app/server/server.ts Normal file
View File

@@ -0,0 +1,24 @@
import * as express from 'express';
import * as http from 'http';
import {AddressInfo} from 'net';
const G = {
port: parseInt(process.env.PORT!, 10) || 8484,
host: process.env.HOST || 'localhost',
};
export async function main() {
const app = express();
const server = http.createServer(app);
app.use(express.static('static'));
// Start listening.
await new Promise((resolve, reject) => server.listen(G.port, G.host, resolve).on('error', reject));
const address = server.address() as AddressInfo;
console.warn(`Server listening at http://${address.address}:${address.port}`);
}
if (require.main === module) {
main().catch((err) => console.error(err));
}

9
app/server/tsconfig.json Normal file
View File

@@ -0,0 +1,9 @@
{
"extends": "../../buildtools/tsconfig-base.json",
"compilerOptions": {
"outDir": "../../build/app/server",
},
"references": [
{ "path": "../common" }
]
}