I am new to Ionic and building a hybrid application not targeted to any specific platform.
I am using putty to run the application using the command “Ionic serve”. When I close the putty, the application doesn’t work.
Currently I am using Linux server to run the application. Please help
Ionic Serve (As far as I’m aware) is used just for testing. I don’t think it would be wise to try and deploy an app that is used over the web that way since it houses everything inside your app. So when I’m developing I have multiple terminal/putty windows going at the same time. 1 for Ionic Serve, 1 for building to different platforms, 1 for other things (maybe an SSH window for example).
The reason it doesn’t work when you close the window also is because it actually runs a web server instance that your app is hosted on. So mine is hosted on localhost:3000, so if the server is not running anymore, your web browser won’t be able to locate that path.
I hope this gave you some details in the right direction.
You mentioned you are on a linux environment, I haven’t actually tried it with Ionic Serve yet but there is a node module named Forever. Forever can create a daemon of the node script you want to run and then keep it alive even if it crashes. This is an excellent article on how Forever works (it’s relatively simple)