Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jabis Sevón
/
gun-multiserver
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
971901b5
authored
2020-04-21 21:52:09 +0000
by
root
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix modules
1 parent
fd6cac3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
server.js
server.js
View file @
971901b
...
...
@@ -4,6 +4,7 @@
* MIT Licensed (C) QXIP 2020
*/
const
fs
=
require
(
"fs"
);
const
url
=
require
(
"url"
);
const
Gun
=
require
(
"gun/gun"
);
// do not load storage adaptors by default
require
(
"./gun-ws.js"
);
// required to allow external websockets into gun constructor
...
...
@@ -12,15 +13,16 @@ const http = require("http");
const
https
=
require
(
"https"
);
const
WebSocket
=
require
(
"ws"
);
var
debug
=
process
.
env
.
DEBUG
||
false
;
var
config
=
{};
config
.
options
=
{
key
:
process
.
env
.
SSLKEY
?
fs
.
readFileSync
(
process
.
env
.
SSLKEY
)
:
fs
.
readFileSync
(
'
src/assets
/server.key'
),
cert
:
process
.
env
.
SSLCERT
?
fs
.
readFileSync
(
process
.
env
.
SSLCERT
)
:
fs
.
readFileSync
(
'
src/assets
/server.cert'
)
key
:
process
.
env
.
SSLKEY
?
fs
.
readFileSync
(
process
.
env
.
SSLKEY
)
:
fs
.
readFileSync
(
'
cert
/server.key'
),
cert
:
process
.
env
.
SSLCERT
?
fs
.
readFileSync
(
process
.
env
.
SSLCERT
)
:
fs
.
readFileSync
(
'
cert
/server.cert'
)
}
if
(
!
process
.
env
.
SSL
)
{
var
server
=
http
.
createServer
();
server
.
listen
(
process
.
env
.
port
||
3000
);
server
.
listen
(
process
.
env
.
PORT
||
3000
);
}
else
{
var
server
=
https
.
createServer
(
config
.
options
);
server
.
listen
(
process
.
env
.
PORT
||
443
);
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment