Closed AC-Unicorn closed 5 years ago
fix #3
is this PR ready for review?
Currently, we still can't build in production mode ( Or aot mode) since the leaflet error still exists. The reason is unclear. So I changed build command in "Package.json" back to default build mode. I think we can merge the PR right now, and I'll do more research about the error, since the reason might be non-trivial.
I've just tested on server with host changed to 0.0.0.0
. it still gives me the error
ReferenceError: Can't find variable: L
I've just tested on server with host changed to
0.0.0.0
. it still gives me the errorReferenceError: Can't find variable: L
Did you use "Empty Cache and Hard Reload"? assuming you are using chrome.
OK that works. but it still cannot talk to backend. please change the production environment to be host='0.0.0.0'
in frontend
interesting, it still shows that
[Error] Failed to load resource: Could not connect to the server. (tweet-count, line 0)http://0.0.0.0:2333/data/recent-temp
interesting, it still shows that
[Error] Failed to load resource: Could not connect to the server. (tweet-count, line 0)http://0.0.0.0:2333/data/recent-temp
Is the backend server running on 2333?
yes, the backend is severing on 2333.
and I can get response with
http://wildfires.ics.uci.edu:2333/data/recent-temp
I've manually changed the environment.ts
for the host to be wildfires.ics.uci.edu
and it is working now.
However we'd better fix the prod mode soon.
By adding a statement in polyfill.js, now the frontend can be compiled in production mode. Angular will build the project into two bundles, one uses ES2015 syntax another one uses ES5 syntax which is older. To be compatible with all browsers, Polyfills in angular are few lines of code which make your application compatible for different browsers.
I will postpone merging this PR as it is a relatively hacky way. the online demo is using this branch now.
fixed #3
Logits of this PR
Changes of this PR
Future improvement