Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Alfakhori
M4labplatform
Commits
83a8cbbc
Commit
83a8cbbc
authored
Sep 11, 2020
by
Patrick
Browse files
test
parent
b76998c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
server.js
View file @
83a8cbbc
const
http
=
require
(
'
http
'
);
const
http
=
require
(
'
https
'
);
const
fs
=
require
(
'
fs
'
);
const
express
=
require
(
'
express
'
)
const
app
=
express
();
const
bodyParser
=
require
(
'
body-parser
'
)
// app.use(bodyParser.urlencoded({ extended: false }))
// app.use(bodyParser.json())
const
request
=
require
(
'
ajax-request
'
);
// app.use(express.static('vcm'));
// app.listen(process.env.PORT || 8083);
const
fs
=
require
(
'
fs
'
);
const
http
=
require
(
'
http
'
);
const
https
=
require
(
'
https
'
);
const
express
=
require
(
'
express
'
);
//
const app = express();
const
app
=
express
();
// Certificate
const
privateKey
=
fs
.
readFileSync
(
'
/etc/letsencrypt/live/umfrage.smartvillages.online/privkey.pem
'
,
'
utf8
'
);
...
...
@@ -24,35 +17,19 @@ const credentials = {
ca
:
ca
};
app
.
use
(
express
.
static
(
__dirname
,
{
dotfiles
:
'
allow
'
}
));
app
.
use
(
express
.
static
(
'
vcm
'
));
// Starting both http & https servers
const
httpServer
=
http
.
createServer
(
app
);
const
httpsServer
=
https
.
createServer
(
credentials
,
app
);
httpServer
.
listen
(
808
4
,
()
=>
{
console
.
log
(
'
HTTP Server running on port 80
'
);
httpServer
.
listen
(
808
3
,
()
=>
{
console
.
log
(
'
HTTP Server running on port 80
'
);
});
httpsServer
.
listen
(
808
3
,
()
=>
{
console
.
log
(
'
HTTPS Server running on port
808
3
'
);
httpsServer
.
listen
(
808
4
,
()
=>
{
console
.
log
(
'
HTTPS Server running on port
44
3
'
);
});
// app.post('/addpoint', function(req,res){
// try {
// const data = req.body;
// console.log("data ==============")
// console.log(data.id);
// args.gmlid = data.id
// console.log(data[0]);
// console.log(data[1]);
// console.log("args ==============")
// console.log(args);
// }
// catch (err) {
// console.log('.../getSimS failed!\n' + err);
// }
// });
\ No newline at end of file
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