Search code examples
node.jsreactjsrestify

Node.js react and rest routes in same project


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.


Solution

  • 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/