标签:tar base ceshi express function 前端资源 bash shel link
1 /*加载模块*/ 2 var express = require(‘express‘); 3 var http = require(‘http‘); 4 var path = require(‘path‘); 5 /*创建服务*/ 6 var app = express(); 7 app.set(‘port‘, 80); 8 app.use(express.static(path.join(__dirname, ‘public‘))); 9 /*服务启动*/ 10 http.createServer(app).listen(app.get(‘port‘), function() { 11 console.log(‘静态资源服务器已启动,监听端口:‘ + app.get(‘port‘)); 12 });
https://stackoverflow.com/questions/31579509/can-pm2-run-an-npm-start-script
(1) 原生支持
pm2 start npm -- start
(2) shell脚本
wrote shell script below (named start.sh). Because my package.json has prestart option. So I want to run npm start.
1 #!/bin/bash 2 cd /path/to/project 3 npm start
Then, start start.sh by pm2.
pm2 start start.sh --name appNameYouLike
1)环境变量 env
分别是 development,testing,production,对应开发,测试和线上,统一通过PHP打到js变量env中。
可以使用这些变量来控制api的地址,比如如下:
var api_base = (env === ‘production‘) ? ‘//open.che300.com‘ : ‘//open.ceshi.che300.com‘;
2)HTTP和HTTPS问题
我们页面中的前端资源和访问的接口,都统一配置成 // 开头,来根据实际域名切换http协议。
<script type="text/javascript" src="//fezz.che300.com/cves/wap/dist/lib/js/jquery-1.9.1.min.js?v=297"></script>
https://stackoverflow.com/questions/31867068/how-to-remove-a-auto-hyperlinked-phone-number-from-microsoft-edge
The solution that works for iOS devices also works for Microsoft Edge.
Adding the meta tag,
<meta name="format-detection" content="telephone=no">
will prevent the DOM document from being modified when parsed by the browser.
https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
autocomplete="off"
---- to ----
autocomplete="false"
标签:tar base ceshi express function 前端资源 bash shel link
原文地址:http://www.cnblogs.com/dahe1989/p/7183747.html