{"id":288,"date":"2020-04-10T05:02:06","date_gmt":"2020-04-10T05:02:06","guid":{"rendered":"https:\/\/docs.theironnetwork.org\/hulk\/?page_id=288"},"modified":"2020-04-13T11:45:06","modified_gmt":"2020-04-13T11:45:06","slug":"deployment","status":"publish","type":"page","link":"https:\/\/docs.theironnetwork.org\/hulk\/deployment\/","title":{"rendered":"Deployment"},"content":{"rendered":"\n<p> To create a production build you need to run the command <code>npm run build<\/code>. It will create the <code>build <\/code>folder, that contains the production build files. Now you just need to upload the <code>build <\/code>files on to the server. <\/p>\n\n\n\n<h5> Static Server: <\/h5>\n\n\n\n<p>For environments using <a rel=\"noreferrer noopener\" href=\"https:\/\/nodejs.org\/\" target=\"_blank\">Node<\/a>, the easiest way to handle this would be to install <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/zeit\/serve\" target=\"_blank\">serve<\/a> and let it handle the rest: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm install -g serve\nserve -s build <\/pre>\n\n\n\n<h5> Other Solutions: <\/h5>\n\n\n\n<p>You don\u2019t necessarily need a static server in order to run a project in  production. It works just as fine integrated into an existing dynamic  one. <\/p>\n\n\n\n<p>Here\u2019s a programmatic example using <a rel=\"noreferrer noopener\" href=\"https:\/\/nodejs.org\/\" target=\"_blank\">Node<\/a> and <a rel=\"noreferrer noopener\" href=\"http:\/\/expressjs.com\/\" target=\"_blank\">Express<\/a>: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const express = require('express');\nconst path = require('path');\nconst app = express();\napp.use(express.static(path.join(__dirname, 'build')));\napp.get('\/', function (req, res) {\n   res.sendFile(path.join(__dirname, 'build', 'index.html'));\n});\napp.listen(9000); <\/pre>\n\n\n\n<h5>Apache HTTP server: <\/h5>\n\n\n\n<p> If you\u2019re using <a rel=\"noreferrer noopener\" href=\"https:\/\/httpd.apache.org\/\" target=\"_blank\">Apache HTTP Server<\/a>, you need to create a <code>.htaccess<\/code> file in the <code>public<\/code> folder that looks like this: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Options -MultiViews\nRewriteEngine On\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteRule ^ index.html [QSA,L]<\/pre>\n\n\n\n<p>Upload the <code>build<\/code> files in the public folder. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>To create a production build you need to run the command npm run build. It will create the build folder, that contains the production build files. Now you just need to upload the build files on to the server. Static Server: For environments using Node, the easiest way to handle this would be to install [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":14,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/docs.theironnetwork.org\/hulk\/wp-json\/wp\/v2\/pages\/288"}],"collection":[{"href":"https:\/\/docs.theironnetwork.org\/hulk\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.theironnetwork.org\/hulk\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/hulk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/hulk\/wp-json\/wp\/v2\/comments?post=288"}],"version-history":[{"count":24,"href":"https:\/\/docs.theironnetwork.org\/hulk\/wp-json\/wp\/v2\/pages\/288\/revisions"}],"predecessor-version":[{"id":321,"href":"https:\/\/docs.theironnetwork.org\/hulk\/wp-json\/wp\/v2\/pages\/288\/revisions\/321"}],"wp:attachment":[{"href":"https:\/\/docs.theironnetwork.org\/hulk\/wp-json\/wp\/v2\/media?parent=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}