看了淘宝UED上关于用nodejs做前后端分离的blog,打算学习下,但是没什么思路,请教有没有什么demo,或者简单的例子
ringa_lee2017-04-17 11:56:32
There is no example to describe the simplest implementation.
1. Create a node project and provide a get:test
Route, return a JSON string {"success":true}. Run on port 3000, test 127.0.0.1:3000/test
Can the expected value be returned? No, debug; success, next step.
2. Create a node project, add a page html template: Page, and define route/page. /page, through node js to 127.0.0.1:3000/test
Initiate an http:get request, fill the returned results into the render page and return. Run on port 3001 and see if 127.0.0.1:3001/page can display {"success":true}