PeanutQAQ / dev-note

node 开发 & 部署笔记

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node.js Deploy

部署前准备

  1. 安装 git & vscode 等
  2. 安装 nvm 管理 Node 版本
  3. 安装 pm2 启动 Node 程序
  4. 安装 Nginx 管理各个 Node 项目的端口
  • 运行 nginx -t 查找 nginx 安装位置
  • 区分 conf.d 与 nginx.conf 的关系
  • 在 conf.d 中拆分不同服务的 Nginx 配置
  • 增加 https 证书
  1. 采用 NginxConfig 生成 Nginx 配置文件
  2. 安装 serve 做静态服务器

TODO

  1. docker 容器化
  2. 使用 express
  3. 制作脚手架生成前后端技术 template

第三方快速部署工具

https://app.netlify.com/teams/peanutqaq/sites netlify 快速部署自己的项目 https://ngrok.com/ ngrok 把自己本地项目反向代理到网上 通过把 win10 的公钥上传到远程主机 摆脱了每次都要输入密码的问题: 原理参考:https://www.ruanyifeng.com/blog/2011/12/ssh_remote_login.html windows无 copy-ssh-id解决:https://xmanyou.com/windows-10-ru-he-zai-widnows10shang-yong-sshdeng-lu-ubuntu/

About

node 开发 & 部署笔记

License:MIT License