A metalsmith plugin to serve the build directory. Best used in development and with metalsmith-watch.
$ npm install metalsmith-serve
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.
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.
Type: String
Default: localhost
Hostname or IP to listen on.
Type: Number
Default: 8080
Port to listen on.
Type: Number
Default: 0
Number of seconds to cache served files
Type: Boolean
Default: false
Log all requests
MIT