Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Webapplication/-site structure with express.js and restify.js
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Daniel Rinehart  
View profile  
 More options Oct 17 2012, 9:52 pm
From: Daniel Rinehart <dani...@neophi.com>
Date: Wed, 17 Oct 2012 21:51:56 -0400
Local: Wed, Oct 17 2012 9:51 pm
Subject: Re: [nodejs] Webapplication/-site structure with express.js and restify.js
Something to quickly check, if you are not getting any reaction from
mongoose in the admin site using the same models, have you ensured
that you are initializing the mongo connection in the admin. Mongoose
will queue commands until a connection is established.

One approach that I've used it to create a private module with just
the models that both the web site and admin site can use. With "npm
link" you can set it up locally and then only "copy" on deploy.

-- Daniel R. <dani...@neophi.com> [http://danielr.neophi.com/]

On Wed, Oct 17, 2012 at 4:13 PM, Manuel Schoebel <m...@manuelschoebel.de> wrote:
> Hi, i am playing with node.js for a little while now and ran in an issue i
> want to adress. For this i would like to get some advice.

> First: I'm building a website (it is more a test-project where i'd like to
> test and learn some things, so it is okay for me if i "overcomplicate"
> things). On the website there is also a blog. I also build a little admin
> interface. The admin interface will be its own node.js app. So i have the
> website and website-admin as two independent projects.

> I use express.js and mongoose.

> The "Problem":
> I tried to share the models of the website with the admin but this does not
> work. If i try to get some data in the admin via the websites models, i do
> not get any reaction from mongoose, not even an error. As i read somewhere
> the models cannot be shared between apps. One option would be to copy the
> models into the admin-app. But i do not really like this approach.

> What i want to do:
> So i am thinking to separate the models and whole db into a third app. An
> api with restify.js. So the website and the admin can use the api and i
> would only have the models in one place. The glue between all would be
> node-proxy (somehow, i am not exactly sure how to do this right now ;).

> Is there a better way to share the models if i want to separate the admin
> and the website as its own node-apps? Does this sound stupid to you? Why?

> Best regards
> Manuel

> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> 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 post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.