Thanks for your replay. There will be lot on traffic in both REST API's and WEB so i have created a two node instance and running in different port and with different routes, so that I can configure in nignx to redirect to same application.
For both the API and WEB application DB will be same. SO I am thinking to create a separate folder for models and methods(CRUD) that can be used for both API and WEB. Any comments. On Wednesday, April 22, 2015 at 2:23:09 AM UTC+5:30, // ravi wrote: > > On Apr 21, 2015, at 5:33 AM, vivek gs <[email protected] <javascript:>> > wrote: > > I am new to node.js and MEAN Stack. > > > > I am developing an application which will have 2 part. > > 1. REST Application which I have created a REST API's for Mobile Client > to send the json data. The API's will process the data and store it > MongoDB. > > 2. WEB Application which will use the same MongoDB and it will show in > browser. > > > > I have created a folder XYZ has my project name. Inside that I have > created two folders api and web. In Web i am using a MEAN.JS has it is a > frontend application and for Api I have started from scratch using > express.js and other require modules. > > > > 1. How can I start the both application in different port. > > > Do they have to be on different ports? Why not use Express’s routing > capabilities to serve both the REsT API and the web pages from a single web > server instance? > > XYZ <— root of your app > XYZ/api or XYZ/routes <— the API to your DB > XYZ/web or XYZ/static <— the web pages and browser side JS > > > > 2. What is the best method to follow these type of scenario. > > > The advice I’d give you is this: if you are new to NodeJS, and if you are > writing a real app (not a demo app to learn the ropes), do not commit to > platforms like MEAN, unless you are already proficient with Mongo and > Angular, and want to leverage that expertise. > > —ravi > > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/f0d3628f-d668-4733-a149-1a2dd8096a1c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
