On Apr 21, 2015, at 5:33 AM, vivek gs <[email protected]> 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/10F6AA2B-0B25-4C62-9DC4-33310E7891E9%40g8o.net.
For more options, visit https://groups.google.com/d/optout.