Authored by xuqi

docs change

... ... @@ -51,10 +51,18 @@ conf/vhosts,nginx注册表文件,restart-nginx.bat, start-nginx.bat, start-php5.
修改完成后可以直接点击start-php5.3.29.bat 和 start-nginx.bat启动PHP和NGINX的服务
PS: nginx的vhost配置参考附件
### 配置HOSTS
#### H5
127.0.0.1 m.dev.yohobuy.com
127.0.0.1 static.m.dev.yohobuy.com
#### WEB
127.0.0.1 web.dev.yohobuy.com
127.0.0.1 webstatic.dev.yohobuy.com
### 最后一步
进入yohobuy/static目录,运行npm install 和 spm install(需要先`spm config set registry http://spm.yoho.cn`将源指定到我们自己的包仓库)安装下依赖, 成功后在当前目录运行`gulp`启动开发环境服务...看看[m.dev.yohobuy.com](m.dev.yohobuy.com)有没有反应?
... ... @@ -64,3 +72,127 @@ Done ? 'congratulations' : '看看是不是缺了什么,不能解决的时候
* js代码风格严格控制,所以请按照[代码规范](http://git.dev.yoho.cn/web/learning-documentation/tree/master/%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91%E7%9B%B8%E5%85%B3/%E4%BB%A3%E7%A0%81%E8%A7%84%E8%8C%83)编码,JS代码采用了pre-commit的hook进行控制,之前需要你安装下[代码检查](http://git.dev.yoho.cn/ued/yoho-fe/tree/master/code-checker)所需要的东西,请了解并执行。
* GIT使用规范你需要熟读,可以看[git flow](http://git.dev.yoho.cn/web/learning-documentation/wikis/home)[pro git](http://git-scm.com/book/en/v2)
* 其他开发中使用到的东西(handlebars,sass,seajs,spm等)请参考git库web/learing documentation或者自行google
## 附:Nginx配置
```
server
{
listen 80;
server_name m.dev.yohobuy.com *.dev.yohobuy.com;
#access_log /nginx/logs/access_test_yoho_cn.log combined;
error_log F:/nginx/logs/error_test_yoho_cn.log warn;
root F:/yohobuy/yohobuy/m.yohobuy.com/public;
# https
#ssl on;
#ssl_certificate //nginx/data/server.pem;
#ssl_certificate_key /nginx/data/server.key;
#ssl_session_timeout 10m;
location / {
index index-dev.php;
if (!-f $request_filename){
rewrite ^/(.+)$ /index-dev.php?$1& last;
}
}
location ~ .*\.php?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index-dev.php;
#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server
{
listen 80;
server_name static.dev.yohobuy.com;
#access_log /nginx/logs/access_test_yoho_cn.log combined;
#error_log /nginx/logs/error_test_yoho_cn.log warn;
root F:/yohobuy/static;
# https
#ssl on;
#ssl_certificate //nginx/data/server.pem;
#ssl_certificate_key /nginx/data/server.key;
#ssl_session_timeout 10m;
location / {
expires 1h;
}
location ~* \.(svg|eot|ttf|woff|otf)$ {
add_header Access-Control-Allow-Origin *;
expires 30d;
}
}
server
{
listen 80;
server_name web.dev.yohobuy.com *.dev.yohobuy.com;
#access_log /nginx/logs/access_test_yoho_cn.log combined;
error_log F:/nginx/logs/error_test_yoho_cn.log warn;
root F:/yohobuy/yohobuy/www.yohobuy.com/public;
# https
#ssl on;
#ssl_certificate //nginx/data/server.pem;
#ssl_certificate_key /nginx/data/server.key;
#ssl_session_timeout 10m;
location / {
index index-dev.php;
if (!-f $request_filename){
rewrite ^/(.+)$ /index-dev.php?$1& last;
}
}
location ~ .*\.php?$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index-dev.php;
#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server
{
listen 80;
server_name webstatic.dev.yohobuy.com;
#access_log /nginx/logs/access_test_yoho_cn.log combined;
#error_log /nginx/logs/error_test_yoho_cn.log warn;
root F:/yohobuy/web-static;
# https
#ssl on;
#ssl_certificate //nginx/data/server.pem;
#ssl_certificate_key /nginx/data/server.key;
#ssl_session_timeout 10m;
location / {
expires 1h;
}
location ~* \.(svg|eot|ttf|woff|otf)$ {
add_header Access-Control-Allow-Origin *;
expires 30d;
}
}
```
\ No newline at end of file
... ...