Comments (1)
生产环境下应该要先build,然后再用pm2启动。命令是npm run start:pm2
,代码如下:
https://github.com/Molunerfinn/vue-koa-demo/blob/master/package.json#L15
nginx方面的配置大概是这样(只给关键部分):
http {
upstream nodeServer {
server 127.0.0.1:8888;
}
server {
listen: 80;
server_name: nodeServer;
location / {
proxy_pass http://nodeServer;
proxy_redirect off;
}
}
}
你可以选择在服务端构建也可以选择在本地构建完把dist目录上传。
代码的话,如果是生产环境,主要就是这几个文件/目录:
- server-entry.js
- app.js
- env.js
- .env
- dist/
- server/
当然不推荐单独把关键文件目录拿出来。推荐是可以把代码放服务端然后在服务端构建。
from vue-koa-demo.
Related Issues (20)
- Docker support HOT 2
- 新年好,楼主请帮忙,这是es6的转义导致的吗? HOT 1
- bcrypt.compareSync is not a function
- ssr分支->reademe.md 对.env配置说明有误 HOT 1
- 代理端口号出错 HOT 6
- 单元测试里面有国际化i18n 报错 HOT 1
- 运行时报错 HOT 1
- 运行时遇到一些问题 HOT 2
- 关于开发环境下ssr的问题 HOT 2
- ssr index.html的问题 HOT 1
- 为什么不能使用import HOT 1
- 库主是用什么版本的linux系统?安装yarn add sequelize mysql HOT 5
- 想搭建远程调试,一直不成功 HOT 7
- 【单元测试】:全局方法的引入 HOT 5
- [单元测试] vue-router的跳转怎么验证? HOT 2
- 数据库连接报错 HOT 5
- server-entry.js 使用babel registry在生产环境是否会造成性能问题 HOT 1
- ssr webpack-hot-middleware error HOT 5
- can this framework handle image uploading and hosting? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-koa-demo.