aboutsummaryrefslogtreecommitdiffstats
path: root/development/beefy.js
blob: 0ed40f177f4454d4e6cf84ced8b58462385f93b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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!')
}