pm2

项目优化

↘锁芯ラ 提交于 2019-12-17 19:37:47
1. 第三方库启用 CDN //vue.config.js-> chainWebpack.config=>{ config.set('externals',{不要打包的依赖项}) } 2. UI 组件按需导入 //把发布模式的main.js element-ui 按需导入文件注释 引用CDN样式和js 3. 路由懒加载 //@babel/plugin-syntax-dynamic-import -> babel.config.js中plugins加上'@插件名' ->把路由修改成按需加载形式 const Login = ()=>import('/* webpackChunkName:"login_home_welcome" */ '路由组件路径') // /* */里写捆绑的自定义路由组 4. 首页内容定制 5. 生成打包报告 报告在vue ui 下面可以看依赖项大小;也可以vue - cli - serve build -- report 其他优化:Nprogress进度条(写在拦截器里,请求拦截start响应拦截done) 1. ESLint代码规范在 . prettierrc里配置(如让一行代码满 2000 字符换行: "printWidth" : 200 ) 2. babel . config . js里可以用remove - console插件(在plugins里写

Deploy node js application with express framework on production mode

空扰寡人 提交于 2019-12-14 03:21:05
问题 How to deploy node js application with express framework with production environment variable with pm2 and generate startup script for reboot with same production environment variable. I have used this so far pm2 start hello.js pm2 startup systemd sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u sammy --hp /home/sammy It starts the application on reboot but in development mode 回答1: To start a Node.js app in production mode, you'd need to set the NODE_ENV like

pm2 start runs but website is not working correctly

天大地大妈咪最大 提交于 2019-12-14 02:23:54
问题 I have a nodeJS project built with yarn. I can run the application on the server using 'yarn start'. It is working correctly. It runs the dist/app.js file when running with yarn. But when i run it using pm2 start app.js, pm2 process starts but application does not works. Any idea? 来源: https://stackoverflow.com/questions/49470269/pm2-start-runs-but-website-is-not-working-correctly

Issue with PM2 and DotEnv not working on ubuntu server

戏子无情 提交于 2019-12-13 03:47:13
问题 I know that there are answers for this question, but I don't want to create one more config file and load all the configuration there and run the pm2 process. Project Structure ----------------- .env index.js -> server is listening in this file routes/ models/ middleware/ startup/ package.json ... Inside package.json { "name": "eventbooking", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "start": "node -r dotenv/config index.js" }, "keywords": [], "author": "",

ubuntu部署.Net Core3.1(Nginx+pm2)

≯℡__Kan透↙ 提交于 2019-12-13 02:11:32
原文: ubuntu部署.Net Core3.1(Nginx+pm2) 前言 虽然.NetCore已经出来很久了,但是很多初学者还是不会在linux部署.所以写一篇初学者在ubuntu下部署Core的全过程,大佬请无视。 环境搭建 ubuntu18.04 NetCore3.1 Nginx pm2 .NetCoreSDK安装 安装源 wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb 安装sdk,具体哪个版本可以根据自己的喜好. sudo add-apt-repository universe sudo apt-get install apt-transport-https sudo apt-get update sudo apt-get install dotnet-sdk-3.1 安装完成执行 dotnet --info 命令查看安装的SDK信息 .Nginx安装 因为.NetCore是自宿主,所以我们需要一个反向代理web服务器来给我的kestrel做反向代理 安装命令 sudo apt-get install

pm2 startup doesn't work

烈酒焚心 提交于 2019-12-12 18:09:28
问题 I setup my nodejs server successfully and I'm using it on Ubuntu 15.04 server, my issue is that I want my node applications to keep running when the server reboots so I tried pm2 , forever and crontab but none of them worked for me, after rebooting I need to start the node application manually. I tried pm2 as follow: pm2 startup ubuntu pm2 start appname pm2 save The pm2-init.sh file: #!/bin/bash # chkconfig: 2345 98 02 # # description: PM2 next gen process manager for Node.js # processname:

PM2 + Meteor not working

大憨熊 提交于 2019-12-12 14:11:55
问题 I get an error when trying to run it: ~/projects/test-app /usr/local/bin/meteor:3 # This is the script that we install somewhere in your $PATH (as "meteor") Here is the command I run: pm2 start meteor-pm2.json And here is meteor-pm2.json: { "name" : "test-app", "script" : "/usr/local/bin/meteor", "MAIL_URL":"smtp://yourmail_configuration_here", "MONGO_URL":"mongodb://localhost:27017/meteor", "ROOT_URL":"https://www.mysite.com/", "PORT":"3000", "out_file":"/home/josh/logs/app.log", "error_file

How to start pm2 http web interface using the ecosystem.json file?

瘦欲@ 提交于 2019-12-12 06:30:43
问题 I am trying to start the pm2 web interface using the ecosystem.json file but the following configuration does not work: { "apps" : [{ "name" : "web", "script" : "", "args" : ["web"], "env": { "NODE_ENV": "development", "PM2_API_IPADDR" : "localhost", "PM2_API_PORT" : "1234" }, "env_production" : { "NODE_ENV": "production", "PM2_API_IPADDR" : "localhost", "PM2_API_PORT" : "1234" }, "env_staging" : { "NODE_ENV" : "staging", "PM2_API_IPADDR" : "localhost", "PM2_API_PORT" : "1234", "TEST" : true

Nginx unable to serve the node.js POST requests

放肆的年华 提交于 2019-12-12 05:24:32
问题 I've a VM Ubuntu15.04 server and I've configured nginx to listen requests on port 80 and forward them to respective applications on different ports. I have a simple node.js service running over port 3000 which has one GET and POST service. I have started it by using PM2 and added a proxy_pass to localhost:3000/ in my nginx default conf. The problem is when i try to use a GET request it is working fine but in case of POST it is showing 404 error. I've tried to use the POST service through

Does travis-ci.org support pm2?

不想你离开。 提交于 2019-12-12 03:25:25
问题 I set up a nodejs auto test with travis-ci.org。I need to set up a server to support static files.I want to know if trvis-ci support pm2:) Or,is there any way to record a server`s pid。 like pm2 do: pm2 start app.js pm2 stop app.js 回答1: You can install pm2 on travis. To do that, you need to change your .travis.yml: before_script: 来源: https://stackoverflow.com/questions/27837455/does-travis-ci-org-support-pm2