Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
323 views
in Technique[技术] by (71.8m points)

vue+nodejs+php如何实现前后端分离

我知道创建接口的肯定还是php,我的疑问是调用接口的是vue还是nodejs,从用户在地址栏输入路由地址到调用后端接口的过程和机制是怎么样的,有没有大佬详细说下。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

不做ssr(服务器渲染)的话,vue+php,即vue直接调用php提供的接口,中间用nginx代理
做ssr的话,vue的话一般用的是nuxtjs,官方也有提供nodejs方式实现ssr.此时是根据实际情况来判断是从vue还是nuxtjs中去请求php接口
nodejs更像后端语言,如php,是用做后端提供服务接口的


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...