您的浏览器不支持JavaScript或者JavaScript的运行被您禁止了。
使用PM2在生产环境部署nodejs项目
本地开发时,可以直接敲node example.js或者运行在package.json文件中定义的命令(比较常见的有npm run dev, npm run start...)。但是线上生产环境是不可以直接这样子跑程序的,因为一旦程序出错,这个服务就挂了。为了让线上生产环境里的项目能用长期处于可用状态,我们可以使用PM2这个包。
暂无评论
通过apache代理,将node服务与指定域名进行绑定
这篇文章应该算《CentOS7-配置Apache虚拟主机》的姊妹篇-_-。我用的操作系统是CentOS7,上网找了很多资料和代码demo,要么是用nginx而非apache实现请求转发的,要么就是通过apache将某个url路径与node服务进行绑定的。所以记录一下如何通过apache代理将node服务与指定域名进行绑定的方法,方便以后查阅。之所以不用nginx,是因为我的vps只有2g内存,已经用了一半内存了,鬼知道以后会不会还要装什么乱七八糟的东西,现在能少装些东西就少装些东西-_-。
暂无评论
花生壳内网映射导致请求失败
有段时间,不知何故,本地的请求通过node环境中的一个叫http-proxy-middleware的包转发本地请求到别人通过花生壳映射的内网后,总是请求失败,会报错:ORAY-ERROR-3。这个显然不会是朋友那边本地服务器的问题,因为这个服务放在公网上时,里面的服务都是可以用的。
暂无评论
Recursion in EJS and Handlebars
Once in a frontend project using handlebars as the template. So, I think probably recursion effect can also be implemented in EJS template. And after some testing, the answer is yes.
暂无评论
Keep Nodejs Program Running after Closing SSH
I happened to find that although my Nodejs program can run normally when I started it through SSH. If I close the SSH connection, then I can no longer visit corresponding frontend file through my browser. Oh my god, the program was closed automatically the time I closed the SSH connection. Here is the solution to the problem:
暂无评论
Deploy Nodejs Project on CentOS
The server is php-and-mysql-available with the help of Webmin (a web-based unix system management tool). So there is no need for me to install mysql myself. What's more, I have already a nodejs program available to run in my laptop (window OS) and the Baidu BAE (unix OS). Due to preassembled php program, the 80 port is employed and the root path for front-end files under 80 port is located in /home/username/public_html. To avoid confusion between php projects and nodejs projects, I created a new folder named "node-server" under /home/orzzone/ path. In a conclusion, I uploaded my Nodejs project files to the path '/home/username/node-server'.
暂无评论
Install Nodejs via package manager on CentOS
I installed Nodejs according to the Nodejs official online instructions. My operation system is Centos 6.5 64bit. Memory is 1.95GB. And disk space is 15 GB. Installing result is as below:
暂无评论
Install Node.js
After you install Node.js by using an installer from the Node.js website. You'll see some executable files and the node_modules folder: node.exe: This file starts a Node.js JavaScript engine. If you pass in a JavaScript file location, Node.js executes that script. If no target avaScript file is specified, a script prompt allows you to execute JavaScript code directly from the console. npm.cmd: You use this command to manage the Node.js packages. node_modules: This folder contains the installed Node.js packages. These packages act as libraries that extend the capabilities of Node.js.
暂无评论
1