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 installhexo-server.
$ npm install hexo-server --save
Once the server has been installed, run the following command to start the server. Your website will run athttp://localhost:4000by 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.
$ hexo server
If you want to change the port or if you’re encounteringEADDRINUSEerrors, use the-poption to set a different port.
$ hexo server -p 5000
Static Mode
In static mode, only files in thepublicfolder will be served and file watching is disabled. You have to runhexo generatebefore starting the server. Usually used in production.
$ hexo server -s
Custom IP
Hexo runs the server at0.0.0.0by default. You can override the default IP setting.