Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
af5b772a
Commit
af5b772a
authored
Nov 27, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add websocket support for remix-sim
parent
8846f8d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
package.json
remix-simulator/package.json
+1
-0
server.js
remix-simulator/src/server.js
+12
-0
No files found.
remix-simulator/package.json
View file @
af5b772a
...
...
@@ -22,6 +22,7 @@
"body-parser"
:
"^1.18.2"
,
"color-support"
:
"^1.1.3"
,
"express"
:
"^4.16.3"
,
"express-ws"
:
"^4.0.0"
,
"fast-async"
:
"^6.3.7"
,
"merge"
:
"^1.2.0"
,
"remix-lib"
:
"0.3.13"
,
...
...
remix-simulator/src/server.js
View file @
af5b772a
const
express
=
require
(
'express'
)
const
bodyParser
=
require
(
'body-parser'
)
const
app
=
express
()
const
expressWs
=
require
(
'express-ws'
)(
app
)
const
Provider
=
require
(
'./provider'
)
const
log
=
require
(
'./utils/logs.js'
)
...
...
@@ -22,4 +23,15 @@ app.use(function (req, res) {
})
})
app
.
ws
(
'/'
,
function
(
ws
,
req
)
{
ws
.
on
(
'message'
,
function
(
msg
)
{
provider
.
sendAsync
(
JSON
.
parse
(
msg
),
(
err
,
jsonResponse
)
=>
{
if
(
err
)
{
ws
.
send
({
error
:
err
});
}
ws
.
send
(
JSON
.
stringify
(
jsonResponse
));
})
});
});
app
.
listen
(
8545
,
()
=>
log
(
'Remix Simulator listening on port 8545!'
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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