Commit 94b050e0 authored by Iuri Matias's avatar Iuri Matias

make linter happy

parent 012de18d
...@@ -6,12 +6,11 @@ const Provider = require('./provider') ...@@ -6,12 +6,11 @@ const Provider = require('./provider')
const log = require('./utils/logs.js') const log = require('./utils/logs.js')
class Server { class Server {
constructor () {
constructor() {
this.provider = new Provider() this.provider = new Provider()
} }
start(port) { start (port) {
expressWs(app) expressWs(app)
app.use(bodyParser.urlencoded({extended: true})) app.use(bodyParser.urlencoded({extended: true}))
...@@ -22,7 +21,7 @@ class Server { ...@@ -22,7 +21,7 @@ class Server {
}) })
app.use((req, res) => { app.use((req, res) => {
provider.sendAsync(req.body, (err, jsonResponse) => { this.provider.sendAsync(req.body, (err, jsonResponse) => {
if (err) { if (err) {
return res.send(JSON.stringify({error: err})) return res.send(JSON.stringify({error: err}))
} }
...@@ -32,7 +31,7 @@ class Server { ...@@ -32,7 +31,7 @@ class Server {
app.ws('/', (ws, req) => { app.ws('/', (ws, req) => {
ws.on('message', function (msg) { ws.on('message', function (msg) {
provider.sendAsync(JSON.parse(msg), (err, jsonResponse) => { this.provider.sendAsync(JSON.parse(msg), (err, jsonResponse) => {
if (err) { if (err) {
return ws.send(JSON.stringify({error: err})) return ws.send(JSON.stringify({error: err}))
} }
...@@ -43,7 +42,6 @@ class Server { ...@@ -43,7 +42,6 @@ class Server {
app.listen(port, () => log('Remix Simulator listening on port ' + port)) app.listen(port, () => log('Remix Simulator listening on port ' + port))
} }
} }
module.exports = Server module.exports = Server
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment