Package Exports
- metalsmith-serve
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (metalsmith-serve) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
metalsmith-serve
A metalsmith plugin to serve the build directory. Best used in development and with metalsmith-watch.
Installation
$ npm install metalsmith-serveBasic Example
var metalsmith = require('metalsmith');
var serve = require('metalsmith-serve');
metalsmith(__dirname)
.use(serve())
.build();This will serve Metalsmith's build directory on localhost:8080. By default, metalsmith-serve will only log error requests.
Advanced Example
var metalsmith = require('metalsmith');
var serve = require('metalsmith-serve');
metalsmith(__dirname)
.use(serve({
port: 8081,
verbose: true
}))
.build();This will serve Metalsmith's build directory on localhost:8081 and will show all served requests.
Options
host
Type: String
Default: localhost
Hostname or IP to listen on.
port
Type: Number
Default: 8080
Port to listen on.
cache
Type: Number
Default: 0
Number of seconds to cache served files
verbose
Type: Boolean
Default: false
Log all requests
License
MIT