myst729 / Vuelog

A backend-free blog system built on top of Vue.js
https://vuelog.js.org/
MIT License
266 stars 39 forks source link

Running dev-server on different host/port? #31

Closed bravo-kernel closed 5 years ago

bravo-kernel commented 6 years ago

Adding this as a note for future visitors. To change the host and/or port start the development server using one of the following commands:

# different host only
npm run dev -- --host 0.0.0.0

# different port only
npm run dev -- --port 8086

# different host and port
npm run dev -- --host 0.0.0.0 --port 8086
bravo-kernel commented 6 years ago

To prevent Invalid Host Header error message also set disableHostCheck option in build/webpack.dev.conf.js to true:

    devServer: {
        disableHostCheck: true,
        // other options
    }
bravo-kernel commented 6 years ago

I would prefer not having to change webpack.dev.conf.js. Any suggestions? The 0.0.0.0 is needed for e.g. running inside Vagrant virtual machines.

myst729 commented 6 years ago

This project is generated from vuejs-templates/webpack. Your request might be better go there. For this repo, just fork and modify at your desire.