1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00
metamask-extension/development/beefy.js
2016-06-30 18:22:16 -07:00

30 lines
636 B
JavaScript

const beefy = require('beefy')
const http = require('http')
const fs = require('fs')
const path = require('path')
const states = require('./states')
const statesPath = path.join(__dirname, 'states.js')
const statesJson = JSON.stringify(states)
fs.writeFileSync(statesPath, statesJson)
const port = 8124
const handler = beefy({
entries: ['mocker.js']
, cwd: __dirname
, live: true
, quiet: false
, bundlerFlags: ['-t', 'brfs']
})
console.dir(handler)
http.createServer(handler).listen(port)
console.log(`Now listening on port ${port}`)
function on404(req, resp) {
resp.writeHead(404, {})
resp.end('sorry folks!')
}