Server

  • 2018-12-03

hexo-server

With the release of Hexo 3, the server has been separated from the main module. To start using the server, you will first have to install hexo-server.

1
$ npm install hexo-server --save

Once the server has been installed, run the following command to start the server. Your website will run at http://localhost:4000 by default. When the server is running, Hexo will watch for file changes and update automatically so it’s not necessary to manually restart the server.

1
$ hexo server

If you want to change the port or if you’re encountering EADDRINUSE errors, use the -p option to set a different port.

1
$ hexo server -p 5000

Static Mode

In static mode, only files in the public folder will be served and file watching is disabled. You have to run hexo generate before starting the server. Usually used in production.

1
$ hexo server -s

Custom IP

Hexo runs the server at 0.0.0.0 by default. You can override the default IP setting.

1
$ hexo server -i 192.168.1.1

Pow

Pow is a zero-config Rack server for Mac.

Install

1
$ curl get.pow.cx | sh

Setup

Symlink the folder into ~/.pow

1
2
$ cd ~/.pow
$ ln -s /path/to/myapp

Your website will be up and running at http://myapp.dev. The URL is based on the name of the symlink.

扫码领红包

2018双11超级红包
PC访问链接: 2018双11超级红包 预售开启 汇聚全球潮流新品

淘口令:¥20Y0b6q4eHR¥ (复制此行再打开手机淘宝客访问)

最后更新: 2018年12月03日 09:29

原始链接: https://cyc.oy99.com/docs/server.html

× 多少都行~
打赏二维码
×
  • {title}