-1

Netlify just as example, same question with CloudFlare Pages etc.

In the past I setup my own server with node and react/vue.

I have my node setup on a server because I don't want to install node and node packages on my local machine.

When I was developing I SSH into the server with port forwarding. So I ran a dev server on port 8888 (npm run dev) on the server and opened http://localhost:8888 in my local browser.

When I make a change to the files I can immediately see the effects without running npm run build.

I am thinking about using a service like netlify because its the right thing to do? But how can I see the changes I make without actually running build?

Is this even possible or do you use theses service only when you are building a website that rarely changes? I am probably missing something. But not sure how to proceed.

I don't know what's the right way. I am very open to suggestions.

Edit: These services that I mentioned are meant for build only. See answer below. I am still leaving this question so people can post suggestions.

jana
  • 3
  • 2
  • "because its the right thing to do" The right thing to do is to develop local and deploy then to your server. Not the other way around. – Marc Apr 14 '22 at 11:47
  • Ok, thanks. Installing all these node packages on your private machine isn't that dangerous? – jana Apr 14 '22 at 12:02
  • Why? If you want to develop node applications, install node. Its that simple.That seems like a non existing problem. Dont make your life harder than it is. – Marc Apr 14 '22 at 12:04
  • If you type `npm malware` in google you will get many results. Also apps get many dependencies that you never actually know about. Isn't that concerning? Am I missing something? If some external server gets infected with no private data, I don't care. But if its my local machine? – jana Apr 14 '22 at 12:14

1 Answers1

0

You cannot do this. Those services are only for hosting the build version of your app. You have to develop it locally and push the build to these services.

Why would you even want to run a development version online?

Obsidianlab
  • 667
  • 1
  • 4
  • 24
  • I do this so I don't have to install node and node packages on my local machine. I am very open to suggestions. What's the right way to do this? – jana Apr 14 '22 at 11:40
  • The only way to do this is to either use a sandbox like codesandbox.io or use a virtual machine. You cannot run a development build on a service like those. Those are only for builds of the services. You should build locally, It is much more flexible than those other solutions. Or you will have to run a Virtual Machine in the cloud and build from there. Or if you have a spare PC lying around use that and SSH into it. – Obsidianlab Apr 14 '22 at 11:44
  • Ok I get it now. codesandbox.io seems really convenient. What are the drawbacks I am missing? You can't use your own local editor (VSC) etc? – jana Apr 14 '22 at 12:00
  • Working on your own machine is much faster since your using your computer's resources (Unless your PC is a potato). Also easier to set up projects again that use similar libraries. Just generally having it run locally and using git for version control is best practise. – Obsidianlab Apr 14 '22 at 12:03
  • Ok. I am afraid of potential malware in npm packages. That's why I don't want a node setup on my laptop. Did I misunderstand something or is this a valid concern? – jana Apr 14 '22 at 12:20
  • I didn't think about it like that. But the malware will still exist and affect the dev and deploy versions of your site. So just don't use the libraries that are vulnerable. But mostly speaking when the build is live the vulnerable packages will affect users that visit the site. So even if you use codesandbox if you go live with those packages the users will be affected. I recommend using any vulnerability scanner. It has a plugin for VS code. Generally speaking these libraries won't affect your local build though. – Obsidianlab Apr 14 '22 at 12:23