Building For Production


#1

Hello, I am just beginning with javascript frameworks and I have 2 questions.


1). After calling the ember build --env production, the system generates the files in the dist/ folder.

But how can I use them on my website??

After calling the index.html file (from “dist /”), I do not see anything on the screen (on the server localhost: 4200 result is correct).


2). What keeps the backend of this forum? PHP, .NET?


I ask for your understanding and support. L


#2

Are you loading index.html via http(s)? If not, that’s probably the issue. You will need a webserver to serve index.html. You can view use your browser’s javascript console to view relevant errors. If you report them back here they will help with debugging.

The forum is a Discourse instance, which is powered by Ruby.


#3

If your website is running Apache add this to your public folder:

What is your backend?


#5

To also answer point 1)

npm install -g http-server

Go to the dist folder and type:

http-server

Then go to http://localhost:8080/ to see your App.


#6

Alternative if you have Python in your system:

python -m SimpleHTTPServer

#7

Thank you all for your reply!


To view the contents of the dist/ folder, I used web server based on Apache (local and real). With .htaccess file (as in php frameworks): RewriteEngine On RewriteCond% {REQUEST_FILENAME}! -f RewriteCond% {REQUEST_FILENAME}! -d RewriteRule ^ (. *) $ index.html [QSA, L]


Unfortunately, after the change: RewriteEngine On RewriteRule ^ index \ .html $ - [L] RewriteCond% {REQUEST_FILENAME}! -f RewriteCond% {REQUEST_FILENAME}! -d RewriteRule (. *) index.html [L] </ IfModule>

I still do not see anything on the screen (under ember server everything is ok).


I try to run this example: Quick Start

and getting these files on dist/: Zip file from tinyupload.com


Apart from instructions in the Getting Started, I have to do something else?

Thanks. L


#8

What errors do you see in your browser’s javascript console?


#9

Javascript Error: Uncaught UnrecognizedURLError: /dl/

“dl” is a folder that contains the files from the dist/

L


#10

Change ENV.baseURL (from Ember 2.7 use ENV.rootURL) for production like this to /dl/


#11

Mr. broerse, that was it! :slight_smile:

Thank you all for your help and understanding.

L