1. Spring的含义
Spring这个术语,意思是,不同的事物处于不同的背景(上下文)中,也指spring 框架项目自身,所有事物的起点.随着时间过去,Spring 项目成为了框架.多数时间,我们讲的Spring是说其全家桶.
Live
Spring这个术语,意思是,不同的事物处于不同的背景(上下文)中,也指spring 框架项目自身,所有事物的起点.随着时间过去,Spring 项目成为了框架.多数时间,我们讲的Spring是说其全家桶.
wordpress本身已经足够慢了。。直到我装了一个主题,wordpress安装排行第一的。
首先,把我服务器CPU占爆满,没办法重启服务器。
然后,加载巨慢。。简直无语的速度。
然后看到别人使用的Node.js架构的博客简直流畅的如丝滑。我都忍不住要重新换个用了。
推荐下https://hexo.io/ 贼流畅,不过想想把文章移过去的麻烦和一些插件不能用。就懒得折腾了。
安装Nginx,Nodejs 安装过程
启动Nodejs服务。express 或者别的什么后台服务
比如启动以后的服务地址 localhost:3000
配置Nginx
/etc/nginx/nginx.conf
server { listen 80 default_server; listen [::]:80 default_server; listen 443 ssl; ssl_certificate /etc/nginx/ssl/xxxx.crt; #你的CRT ssl_certificate_key /etc/nginx/ssl/xxxx.key; #你的Key server_name xxx.com; #域名 ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_protocols SSLv3 TLSv1; root /usr/share/nginx/html; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { proxy_pass http://127.0.0.1:3000; #Node的服务 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-Forward-Proto https; proxy_http_version 1.1; # for websocket proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }
然后重启Nginx
sudo systemctl restart nginx
在小程序里Post
wx.request({
url: “https://xxx.com:443/posts”,
…….
OK~
PS:上面是腾讯云的设置,阿里云的略有所不同。
第一步,添加Nginx 库
sudo yum install epel-release
第二步安装
sudo yum install nginx
输入Y
第三步运行
Nginx does not start on its own. To get Nginx running, type:
sudo systemctl start nginx
如果没什么问题就可以输入网站地址测试。成功的话就见到下面的的图。
因为我同时安装了Apache,所以80端口被占用了。启动的时候报错
Unit start.service could not be found. ● nginx.service - The nginx HTTP and reverse proxy server Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since 三 2018-01-17 18:34:14 CST; 10s ago Process: 4237 ExecStart=/usr/sbin/nginx (code=exited, status=1/FAILURE) Process: 4234 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS) Process: 4233 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS) 1月 17 18:34:12 VM_66_141_centos nginx[4237]: nginx: [emerg] bind() to 0.0....) 1月 17 18:34:12 VM_66_141_centos nginx[4237]: nginx: [emerg] bind() to 0.0....) 1月 17 18:34:13 VM_66_141_centos nginx[4237]: nginx: [emerg] bind() to 0.0....) 1月 17 18:34:13 VM_66_141_centos nginx[4237]: nginx: [emerg] bind() to 0.0....) 1月 17 18:34:14 VM_66_141_centos nginx[4237]: nginx: [emerg] bind() to 0.0....) 1月 17 18:34:14 VM_66_141_centos systemd[1]: nginx.service: control process...1 1月 17 18:34:14 VM_66_141_centos nginx[4237]: nginx: [emerg] still could no...) 1月 17 18:34:14 VM_66_141_centos systemd[1]: Failed to start The nginx HTTP.... 1月 17 18:34:14 VM_66_141_centos systemd[1]: Unit nginx.service entered fai.... 1月 17 18:34:14 VM_66_141_centos systemd[1]: nginx.service failed. Hint: Some lines were ellipsized, use -l to show in full.
这个时候修改配置文件/etc/nginx/nginx.conf
server { listen 8088 default_server; listen [::]:8088 default_server;
然后执行下面命令测试一下
nginx -t -c /etc/nginx/nginx.conf
执行下面命令加入启动项
sudo systemctl enable nginx
Over.
SchemaTypes 可以设置Strings和Numbers,默认defaults,验证validation,getters setters,等等一般特性.
defaults, validation, getters, setters, field selection defaults for queries and .点击查看具体API
SchemaTypes支持的类型
先说下效果,未开启的时候,加载Venderjs的速度380K加载了12s
开启Gzip后,提升了一倍多。平均2秒到3秒。。verygood