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

Thursday, September 1, 2022

[FIXED] How to run nuxt dev on a production server

 September 01, 2022     nginx-reverse-proxy, nuxt.js, pm2     No comments   

Issue

I'm using Nuxt 2.15.4 and I have deployed my app on a cloud-server using nginx and pm2.

I can access my website by using its domain address. Now I want to use npm run dev on another post on my server for development beside the main running website. For example https://example.com:3333 show me the dev (live) mode so that I can see changes live.

How can I do that??


Solution

What do you mean by "development on one of them"? Should should probably not change your code based on some handmade changes, that will not be tracked by git. How are you supposing to find bugs if you do untracked changes like this?

And also, I'm not sure what requires that kind of workflow?

If you have an issue on your production environment, you should fix it locally and deploy it there by knowing what are the specific differences in production.

For your question, depending if PM2 is able to run a project with a Node.js server (I guess) it could and that you can access it with SSH (maybe you cannot), you could basically do this:

  • run a dev server on a specific port
  • connect via SSH to that specific server and make on the fly-changes
  • wait 5 hours for the page too refresh (not a bundled build so yeah, dev server will take ages to update the changes...)

Still, it's super ugly to "make changes" like this. To understand what is buggy may be a viable use case but you could at this point, dump the production database into local or reproduce the behavior of the production locally. Anyway, I do highly not recommend this idea of running a dev server on production.



Answered By - kissu
Answer Checked By - Senaida (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