-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
34 lines (24 loc) · 978 Bytes
/
server.js
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
'use strict';
const fs = require('fs');
const express = require('express');
const path = `${__dirname}/node_modules/jsworks/dist/`;
const testsPath = `${__dirname}/spec`;
const fontAwesomePath = `${__dirname}/node_modules/font-awesome/`;
const app = express();
express.static.mime.define({'application/javascript': ['js']});
app.use('/', express.static(`${__dirname}/dist/out`));
app.use('/static', express.static(`${__dirname}/static`));
app.use('/jsworks', express.static(path));
app.use('/babylonjs', express.static(`${__dirname}/node_modules/babylonjs`));
app.use('/font-awesome', express.static(fontAwesomePath));
app.get('/', (req,res) => {
res.sendFile(__dirname + '/application.html');
});
app.use((req, res, next) => {
res.sendFile(__dirname + '/application.html');
});
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Test Application server listening on port ${PORT}!`);
console.log(`JSWorks is in ${path}`);
});