PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, September 6, 2022

[FIXED] How to serve a Nuxt application with a different cli

 September 06, 2022     express, javascript, nuxt.js, vue.js, web-deployment     No comments   

Issue

I have a pretty simple question, but after spending a couple of hours trying to find something on the internet, I've found no success at obtaining a method.

I have a nuxt.js SPA that I am building, but my company firewall seems to be blocking the content when other users try to go to the host/port that it is being served at. I have served things at this location in the same method before with no issues. The fact that I am building/serving it with the NUXT library introduced this complication with the firewall.

I would like to simply try serving the nuxt build with another service, maybe the vue-cli-service but preferably express.js, to see if those might be able to agree with the firewall.

I just don't know how to get the vue-cli-service to serve the nuxt build from the _nuxt folder (assuming that is in fact that build), or express.js either for that matter.

How would I go about doing this? When I try to just say "vue-cli-service serve" it comes back with a gripe about not being able to find the '/src/main.js,' which is of course because nuxt uses a different file structure.


Solution

Nuxt can use express or koa or their internal server wrapper. That does not matter at all when it comes to firewall. Nuxt by default serves at port localhost:3000. Probably the port is blocked on your firewall. Try host 0.0.0.0 with some other ports like 8080 or something. More info nuxtjs.org/faq/host-port



Answered By - Orkhan Alikhanov
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing