{"id":215,"date":"2015-04-16T03:57:43","date_gmt":"2015-04-16T03:57:43","guid":{"rendered":"https:\/\/www.tech.shinynewthings.com\/?p=215"},"modified":"2015-04-16T15:45:17","modified_gmt":"2015-04-16T15:45:17","slug":"ember-heroku","status":"publish","type":"post","link":"https:\/\/www.tech.shinynewthings.com\/?p=215","title":{"rendered":"Ember -> Heroku"},"content":{"rendered":"<p>After you&#8217;ve created a Ember-Cli app, create a Procfile, it will tell Heroku what to do when your application starts.<\/p>\n<p><a href=\"https:\/\/devcenter.heroku.com\/articles\/procfile\">&#8220;Procfile is a mechanism for declaring what commands are run by your application&#8217;s dynos on the Heroku platform.&#8221;<\/a><\/p>\n<pre>touch Procfile\n<\/pre>\n<p>In Procfile.<\/p>\n<pre>web: ember serve --port $PORT --live-reload=false\n<\/pre>\n<p>In package.json make sure you have something like the following.<\/p>\n<p>Note: the Ember team is depreciating Bower moving forward but Heroku is happy with it for the moment. This will install dependencies.<\/p>\n<pre>\"scripts\": {\n    \"start\": \"ember server\",\n    \"build\": \"ember build\",\n    \"test\": \"ember test\",\n    \"postinstall\": \".\/node_modules\/bower\/bin\/bower install\"\n  },\n<\/pre>\n<p>Change the package.json node &#8220;devDependencies&#8221; to &#8220;dependencies&#8221; or change the Heroku config to use the Dev Dependencies with the following line.<\/p>\n<pre>\nheroku config:set NPM_CONFIG_PRODUCTION=false\n<\/pre>\n<p>If you are using external resources, in config\/environment.js, do something like the following to get things running and then strip it back.<\/p>\n<p>Note: use <a href=\"http:\/\/en.wikipedia.org\/wiki\/Wikipedia:Protocol-relative_URL\">relative protocols<\/a> to avoid mixed content issues.<\/p>\n<p>&#8220;mixed content was loaded over HTTPS, but requested an insecure script&#8221;<\/p>\n<p>Caution! This is for a <strong>TEST<\/strong> application that uses external javascript, fonts, images and stylesheets.<\/p>\n<pre>ENV.contentSecurityPolicy = {\n\n    'default-src': \"'self'\",\n    'script-src': \"'self' http:\/\/localhost:4200 'unsafe-eval' * 'unsafe-inline' *\",\n    'font-src': \"'self' 'unsafe-eval' * 'unsafe-inline' *\",\n    'connect-src': \"'self'\",\n    'img-src': \"'self' 'unsafe-eval' * 'unsafe-inline' *\",\n    'style-src': \"'self' 'unsafe-eval' * 'unsafe-inline' *\",\n    'media-src': \"'self'\"\n  }\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>After you&#8217;ve created a Ember-Cli app, create a Procfile, it will tell Heroku what to do when your application starts. &#8220;Procfile is a mechanism for declaring what commands are run by your application&#8217;s dynos on the Heroku platform.&#8221; touch Procfile In Procfile. web: ember serve &#8211;port $PORT &#8211;live-reload=false In package.json make sure you have something [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-215","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=215"}],"version-history":[{"count":10,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/215\/revisions"}],"predecessor-version":[{"id":226,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/215\/revisions\/226"}],"wp:attachment":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}