Browse Source

added --spa to cli options

master
Lloyd Brookes 9 years ago
parent
commit
c6f6fcdcc1
  1. 2
      README.md
  2. 7
      jsdoc2md/README.hbs
  3. 4
      lib/cli-options.js
  4. 2
      lib/local-web-server.js

2
README.md

@ -203,8 +203,6 @@ serving at http://localhost:8100
## API Reference
<a name="module_local-web-server"></a>
## local-web-server
<a name="exp_module_local-web-server--localWebServer"></a>
### localWebServer([options]) ⏏
Returns a Koa application

7
jsdoc2md/README.hbs

@ -203,7 +203,12 @@ serving at http://localhost:8100
## API Reference
{{>main}}
{{#module name="local-web-server"}}
{{>body~}}
{{>member-index~}}
{{>separator~}}
{{>members~}}
{{/module}}
* * *

4
lib/cli-options.js

@ -29,6 +29,10 @@ module.exports = {
description: 'A list of URL rewrite rules', group: 'server'
},
{
name: 'spa', alias: 's', type: String,
description: 'Single Page App page', group: 'server'
},
{
name: 'help', alias: 'h', type: Boolean,
description: 'Print these usage instructions', group: 'misc'
},

2
lib/local-web-server.js

@ -130,7 +130,7 @@ function localWebServer (options) {
if (options.spa) {
const send = require('koa-send')
app.use(_.all('*', function * () {
yield send(this, options.spa, { root: options.static.root || process.cwd() })
yield send(this, options.spa, { root: path.resolve(options.static.root) || process.cwd() })
}))
}
return app

Loading…
Cancel
Save