Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Alfakhori
M4labplatform
Commits
dab6957e
Commit
dab6957e
authored
4 years ago
by
Patrick
Browse files
Options
Download
Email Patches
Plain Diff
test server update auf ssl
parent
a02e9d7a
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server.js
+26
-1
server.js
with
26 additions
and
1 deletion
+26
-1
server.js
+
26
-
1
View file @
dab6957e
...
@@ -7,10 +7,35 @@ app.use(bodyParser.urlencoded({ extended: false }))
...
@@ -7,10 +7,35 @@ app.use(bodyParser.urlencoded({ extended: false }))
app
.
use
(
bodyParser
.
json
())
app
.
use
(
bodyParser
.
json
())
const
request
=
require
(
'
ajax-request
'
);
const
request
=
require
(
'
ajax-request
'
);
// app.use(express.static('vcm'));
// app.listen(process.env.PORT || 8083);
const
app
=
express
();
// Certificate
const
privateKey
=
fs
.
readFileSync
(
'
/etc/letsencrypt/live/umfrage.smartvillages.online/privkey.pem
'
,
'
utf8
'
);
const
certificate
=
fs
.
readFileSync
(
'
/etc/letsencrypt/live/umfrage.smartvillages.online/cert.pem
'
,
'
utf8
'
);
const
ca
=
fs
.
readFileSync
(
'
/etc/letsencrypt/live/umfrage.smartvillages.online/chain.pem
'
,
'
utf8
'
);
const
credentials
=
{
key
:
privateKey
,
cert
:
certificate
,
ca
:
ca
};
app
.
use
(
express
.
static
(
'
vcm
'
));
app
.
use
(
express
.
static
(
'
vcm
'
));
app
.
listen
(
process
.
env
.
PORT
||
8083
);
// Starting both http & https servers
const
httpServer
=
http
.
createServer
(
app
);
const
httpsServer
=
https
.
createServer
(
credentials
,
app
);
// httpServer.listen(80, () => {
// console.log('HTTP Server running on port 80');
// });
httpsServer
.
listen
(
8083
,
()
=>
{
console
.
log
(
'
HTTPS Server running on port 8083
'
);
});
// app.post('/addpoint', function(req,res){
// app.post('/addpoint', function(req,res){
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets