Node.js react and rest routes in same project

ε祈祈猫儿з 提交于 2019-12-08 03:06:05

问题


I’m quite new to NodeJS and made a few apps that act like a rest service , and I call the rest service from an HTML page . I have also made a few react apps.

Question : can I have these 2 types of apps in the same app , so that my react apps can use the local rest URLs. If so , how do I start the app? ( given that there are 2 different command lines to start each type of app.

Sorry if this is a stupid question , still getting my head around all these types of projects . Note : I am using restify package .

Thanks so much.


回答1:


There are plenty of boilerplates out there and i would start by looking at those for advice. What you're looking for is a really common setup. Here is a nice tutorial i found on the matter. https://daveceddia.com/create-react-app-express-backend/



来源:https://stackoverflow.com/questions/47573218/node-js-react-and-rest-routes-in-same-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!