For whatever reason (usually CORS), you'll need to change the host and port of your local Nuxt development server at some point.
Add the following to your package.json
file under the scripts
section.
"dev-host": "nuxt --hostname yourdomain.test --port 3333",
Overall, your scripts
section should look like this.
"scripts": {
"dev": "nuxt",
"dev-host": "nuxt --hostname yourdomain.test --port 3333",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
},
Of course, yourdomain.test
can just be replaced with whatever domain you'd like to use. You can also change the name of the command from dev-host
to whatever you'd prefer.
Depending on your environment and preference, there are a few other ways to configure this. You'll find more over on the official Nuxt docs.