-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
62 lines (41 loc) · 1.95 KB
/
index.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const fs = require('fs');
const key = fs.readFileSync('./ssl/localhost/localhost.decrypted.key');
const cert = fs.readFileSync('./ssl/localhost/localhost.crt');
const express = require('express');
const app = express();
app.get('/', (req, res, next) => {
res.status(200).sendFile('D:\\Javascript_Projects\\SoundSpatialization\\index.html');
});
app.get('/media/beep.mp3', (req, res, next) => {
res.status(200).sendFile('D:\\Javascript_Projects\\SoundSpatialization\\media\\beep.mp3');
});
app.get('/src/SoundController.js', (req, res, next) => {
res.status(200).sendFile('D:\\Javascript_Projects\\SoundSpatialization\\src\\SoundController.js');
});
app.get('/src/OrientationController.js', (req, res, next) => {
res.status(200).sendFile('D:\\Javascript_Projects\\SoundSpatialization\\src\\OrientationController.js');
});
app.get('/src/GpsController.js', (req, res, next) => {
res.status(200).sendFile('D:\\Javascript_Projects\\SoundSpatialization\\src\\GpsController.js');
});
app.get('/src/ArrowController.js', (req, res, next) => {
res.status(200).sendFile('D:\\Javascript_Projects\\SoundSpatialization\\src\\ArrowController.js');
});
app.get('/src/style.css', (req, res, next) => {
res.status(200).sendFile('D:\\Javascript_Projects\\SoundSpatialization\\style\\style.css');
});
app.get('/src/MapController.js', (req, res, next) => {
res.status(200).sendFile('D:\\Javascript_Projects\\SoundSpatialization\\src\\MapController.js');
});
app.get('/src/http_www.openlayers.org_api_OpenLayers.js', (req, res, next) => {
res.status(200).sendFile('D:\\Javascript_Projects\\SoundSpatialization\\src\\http_www.openlayers.org_api_OpenLayers.js');
});
//----
//----
const https = require('https');
const server = https.createServer({ key, cert }, app);
const port = 8080;
server.listen(port, () => {
console.log(`Server is listening on https://localhost:${port}`);
});
console.log('Path of file in parent dir:', require('path').resolve(__dirname, './app.js'));