2019-01-17 06:22:31 +00:00
|
|
|
/* Minimal SSL/non-SSL example */
|
2018-10-28 15:07:21 +00:00
|
|
|
|
2018-12-26 18:19:26 +00:00
|
|
|
const port = 9001;
|
|
|
|
|
2019-01-14 09:09:09 +00:00
|
|
|
const app = uWS./*SSL*/App({
|
2018-12-26 12:50:12 +00:00
|
|
|
key_file_name: '/home/alexhultman/key.pem',
|
|
|
|
cert_file_name: '/home/alexhultman/cert.pem',
|
|
|
|
passphrase: '1234'
|
2019-01-17 06:22:31 +00:00
|
|
|
}).get('/*', (res, req) => {
|
|
|
|
res.end('Hello World!');
|
2018-10-28 15:07:21 +00:00
|
|
|
}).listen(port, (token) => {
|
|
|
|
if (token) {
|
|
|
|
console.log('Listening to port ' + port);
|
|
|
|
} else {
|
|
|
|
console.log('Failed to listen to port ' + port);
|
|
|
|
}
|
|
|
|
});
|