Environment :
1、ionic
2、angular-cli
Develop
1、CTRL C + CTRL V
Question 2, the image path
Use 'assets / xxxxx.jpg', without the use of '../../assets/xxxxx.jpg', because the directory packetized as follows:
Pictures on the server will be reported 404 errors.
3, packaging issues
Packaging commands: After ionic build complete package found size 30M, My goodness, this is certainly not
Production Version: Ionic bulid --prod reduce the size of the lot
4, after the complete package, you can run it locally, nginx for windows good choice
Complete package of all the files and drag / html directory under niginx
Click Start Service nginx.exe
Then open web access localhost and see.
5, but will refresh the page 404, as to what the reasons can be found to the Internet.
solve:
app.module.ts replacement
After it clear the system can be installed nginx.
2.apt-get
-- sudo apt-get install nginx
Agreed to make the election process a Y take up memory.
3. If the packets can not locate nginx, proceed as follows:
-- sudo apt-get update
4. After the update is complete, the installation nginx
-- sudo apt-get install nginx
5, configuration conf
After completion of the installation directory is / etc / nginx
Enter conf.d
Create a new file as a configuration file, the name at random, I have a new well, look at the contents of the documents refer to
Several modifications of the place, the default port number; name ip / domain access; points to file directory, try to know.
Different servers may also need to open port authority, or firewall.
Successful visit: