forked from webmachinelearning/webnn-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
31 lines (27 loc) · 802 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
/*
* Copyright © 2018 Intel Corporation. All Rights Reserved.
*/
'use strict';
const express = require('express');
const fs = require('fs');
const https = require('https');
const app = express();
// Directory 'public' for static files
app.use(express.static(__dirname + '/', {
setHeaders: (res) => {
res.set('Cross-Origin-Opener-Policy', 'same-origin');
res.set('Cross-Origin-Embedder-Policy', 'require-corp');
}
}));
app.use(express.json());
app.use(express.urlencoded({
extended: true
}));
// app.listen("8083");
// console.log('http://127.0.0.1:8083/semantic_segmentation/')
// Start HTTPS server
https.createServer({
cert: fs.readFileSync('cert.pem'),
key: fs.readFileSync('key.pem'),
}, app).listen("8088");
console.log('https://127.0.0.1:8088/semantic_segmentation/')