remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/remix-simulator/src/server.js

25 lines
603 B

const express = require('express')
const bodyParser = require('body-parser')
const app = express()
const Provider = require('./provider')
const log = require('./utils/logs.js')
var provider = new Provider()
app.use(bodyParser.urlencoded({extended: true}))
app.use(bodyParser.json())
app.get('/', (req, res) => {
res.send('Welcome to remix-simulator')
})
app.use(function (req, res) {
provider.sendAsync(req.body, (err, jsonResponse) => {
if (err) {
res.send({error: err})
}
res.send(jsonResponse)
})
})
app.listen(8545, () => log('Remix Simulator listening on port 8545!'))