{"id":2463,"date":"2015-12-29T11:04:03","date_gmt":"2015-12-29T11:04:03","guid":{"rendered":"http:\/\/www.nikola-breznjak.com\/blog\/?p=2463"},"modified":"2015-12-29T11:09:31","modified_gmt":"2015-12-29T11:09:31","slug":"how-to-run-ionic-serve-permanently","status":"publish","type":"post","link":"https:\/\/nikola-breznjak.com\/blog\/stack-overflow\/how-to-run-ionic-serve-permanently\/","title":{"rendered":"How to run Ionic serve permanently?"},"content":{"rendered":"<p><a href=\"http:\/\/stackoverflow.com\/users\/534755\/nikola\"><img loading=\"lazy\" decoding=\"async\" title=\"profile for Nikola at Stack Overflow, Q&amp;A for professional and enthusiast programmers\" src=\"http:\/\/stackoverflow.com\/users\/flair\/534755.png\" rel=\"lightbox[2463]\" alt=\"profile for Nikola at Stack Overflow, Q&amp;A for professional and enthusiast programmers\" width=\"208\" height=\"58\" \/><\/a><br \/>\nI&#8217;m a big fan of <a href=\"http:\/\/stackoverflow.com\/\">Stack Overflow<\/a> and I tend to contribute regularly (am currently in the <a href=\"http:\/\/stackexchange.com\/leagues\/1\/alltime\/stackoverflow\/2008-07-31\/534755?sort=reputationchange#534755\">top 0.X%<\/a>).\u00a0In this category (<a href=\"http:\/\/www.nikola-breznjak.com\/blog\/category\/stack-overflow\/\">stackoverflow<\/a>)\u00a0of posts, I will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread <a href=\"http:\/\/meta.stackoverflow.com\/questions\/266971\/can-i-post-so-questions-and-answers-in-a-personal-blog\/266973\">here<\/a>.<\/p>\n<p>As you may know, I&#8217;m really into Ionic framework lately\u00a0and am helping out on StackOverflow with the knowledge I gained so far with the framework. I&#8217;m in the <a href=\"http:\/\/stackoverflow.com\/tags\/ionic\/topusers\">top All time answerers<\/a> list.<\/p>\n<p>I answered <a href=\"http:\/\/stackoverflow.com\/questions\/34489321\/how-to-run-ionic-serve-permanently\/34489383\">this question<\/a>\u00a0by user <a href=\"http:\/\/stackoverflow.com\/users\/5400173\/santhosh-aineri\">Santhosh Aineri<\/a>:<\/p>\n<p>I am using Ionic framework for one application. The code is on a linux server. I am running the application using ionic serve command through putty.<\/p>\n<p>But, the problem is if I close the putty the application is stopped. Is there any way to run the ionic serve permanently as a daemon process?<\/p>\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/34489321\/how-to-run-ionic-serve-permanently\/34489383#34489383\">My answer<\/a> was:<\/p>\n<blockquote><p>I&#8217;m suspecting you&#8217;re trying to do this because you want to serve your Ionic app as a web app, correct?<\/p>\n<p>In that case &#8211; you don&#8217;t have to run <code>ionic serve<\/code> permanently. All you have to do is take all the code from the <code>www<\/code> folder and place it in the <code>http<\/code> folder (or any other which is valid for your system) of your web server.<\/p>\n<p>So, basically, spin up apache (or nginx) and serve the code from the Ionic&#8217;s <code>www<\/code> folder. Basically, <code>ionic serve<\/code> command does the same thing &#8211; it spins up a local web server and serves the content from the www folder. It does that for faster local testing.<\/p>\n<p>You can take a look at <a href=\"http:\/\/stackoverflow.com\/questions\/33195748\/deploy-ionic-as-a-website\/33198389#33198389\">this SO question<\/a> for more info on how to deploy Ionic as a website.<\/p><\/blockquote>\n<blockquote class=\"twitter-tweet\" data-width=\"550\">\n<p lang=\"en\" dir=\"ltr\">How to run <a href=\"https:\/\/twitter.com\/hashtag\/Ionic?src=hash\">#Ionic<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/serve?src=hash\">#serve<\/a> <a href=\"https:\/\/twitter.com\/hashtag\/permanently?src=hash\">#permanently<\/a>? <a href=\"https:\/\/t.co\/7mbxGdSHFi\">https:\/\/t.co\/7mbxGdSHFi<\/a><\/p>\n<p>&mdash; Nikola Bre\u017enjak (@HitmanHR) <a href=\"https:\/\/twitter.com\/HitmanHR\/status\/681793401952559104\">December 29, 2015<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%).\u00a0In this category (stackoverflow)\u00a0of posts, I will be posting my&hellip;<\/p>\n","protected":false},"author":1,"featured_media":2236,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43,35],"tags":[],"class_list":["post-2463","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ionic","category-stack-overflow"],"_links":{"self":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/2463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/comments?post=2463"}],"version-history":[{"count":3,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/2463\/revisions"}],"predecessor-version":[{"id":2466,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/posts\/2463\/revisions\/2466"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media\/2236"}],"wp:attachment":[{"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/media?parent=2463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/categories?post=2463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nikola-breznjak.com\/blog\/wp-json\/wp\/v2\/tags?post=2463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}