ducky/web
2015-06-30
Parent:99a43a6d1d30
ducky/web/bin/dev-server
Update to use plans instead of PWYW. If we're going to lean on Stripe for most of our subscription processing, we need to use plans, instead of pay what you want. This updates the page to replace our amount input with a plan select box. It also removes the nonsense about finding your first charge date, because Stripe forced us into a simpler, but harder to predict, billing model. We also updated our CSS to work with select boxes, as well as text inputs.
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 })