ducky/web
2015-05-03
ducky/web/bin/dev-server
First commit. Setup project structure, start getting our registration flow set up. At this point, it runs successfully locally, assuming the auth server is running locally at slightly.local:8080. So, uh... on my computer. Also, we currently have the Register button (on the register page) disabled always, because we still need to hook up form validation and set the this.state.valid property. If that property is set to true, then the button is enabled again. Still to do: validation, logging in. Then what we have written works, minus some configuration stuff that still needs to be figured out.
1 #!/usr/bin/env node
3 var fs = require('fs')
4 var path = require('path')
5 var webpack = require('webpack')
6 var WebpackDevServer = require('webpack-dev-server')
7 var argv = require('minimist')(process.argv.slice(2))
8 var findRoot = require('find-root')
9 var rootFolder = findRoot(process.env.PWD)
11 var configfile = '';
13 // get config
14 if (argv.config) {
15 configfile = path.resolve(argv.config)
16 } else {
17 configfile = path.resolve(path.join(rootFolder, 'webpack.config.js'))
18 }
19 argv.config = require(configfile);
21 // run it
22 new WebpackDevServer(webpack(argv.config), {
23 historyApiFallback: true,
24 hot: true,
25 publicPath: argv.config.output.publicPath,
26 }).listen(argv.config.port, argv.config.host, function (err, result) {
27 if (err) {
28 console.log(err)
29 }
30 console.log('development server running at: http://' + argv.config.host + ':' + argv.config.port)
31 })