Skip to content

hexojs/hexo-server

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8b313db · Jul 29, 2020
Jul 24, 2020
Jul 29, 2020
Jul 29, 2020
Dec 5, 2015
Jul 29, 2020
Jul 7, 2019
Dec 29, 2014
Jul 29, 2020
Jul 29, 2020
Jul 29, 2020

Repository files navigation

hexo-server

Build Status NPM version Coverage Status Build status

Server module for Hexo.

Installation

$ npm install hexo-server --save

Usage

$ hexo server
Option Description Default
-i, --ip Override the default server IP. :: when IPv6 is available, else 0.0.0.0 (note: in most systems, :: also binds to 0.0.0.0)
-p, --port Override the default port. 4000
-s, --static Only serve static files. false
-l, --log [format] Enable logger. Override log format. false
-o, --open Immediately open the server url in your default web browser. false

Options

server:
  port: 4000
  log: false
  ip: 0.0.0.0
  compress: false
  cache: false
  header: true
  serveStatic:
  preCompressed: false
  • port: Server port
  • log: Display request info on the console. Always enabled in debug mode.
  • ip: Server IP
  • compress: Enable GZIP compression
  • cache: Enable cache for rendered content
    • This can speed up server response. However, any changes will no longer take effect in real time.
    • Suitable for production environment only.
  • header: Add X-Powered-By: Hexo header
  • serveStatic: Extra options passed to serve-static
  • preCompressed: Serve pre-compressed assets, requires a minifier plugin that supports gzip or brotli

License

MIT