Node server to angular-phonecat with MongoDB and Restful API

802 views
Skip to first unread message

Dalci de Jesus Bagolin

unread,
Mar 22, 2012, 9:47:25 PM3/22/12
to ang...@googlegroups.com
I make a Node server to angular-phonecat with MongoDB and Restful API.
The API allow to access the CRUD operations in db , advanced querys and aggregations commands, like count, distinct, group and mapreduce.


Dalci Bagolin

Vojta Jína

unread,
Mar 23, 2012, 12:21:07 AM3/23/12
to ang...@googlegroups.com
Nice, do you have it running somewhere ?

which responds {"error":"failed to connect to [127.0.0.1:27017]"}.

V.

Dalci de Jesus Bagolin

unread,
Mar 23, 2012, 7:14:47 AM3/23/12
to ang...@googlegroups.com
You need to have a MongoDb server running in localhost.

To define a different url and port of the database, change the line three in the file server.js 

var db = require('mongojs').connect('PhoneCat');
to
var db = require('mongojs').connect('example.com:9999/PhoneCat');

Dalci

Vojta Jína

unread,
Mar 23, 2012, 1:53:34 PM3/23/12
to ang...@googlegroups.com
Great, works great... Cool stuff man.

V.

> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/angular/-/tuYBsSvQNtQJ.
> To post to this group, send email to ang...@googlegroups.com.
> To unsubscribe from this group, send email to
> angular+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/angular?hl=en.

zamir...@gmail.com

unread,
Nov 30, 2012, 3:05:38 PM11/30/12
to ang...@googlegroups.com
I just went through the angular-phonecat tutorial and was looking forward to starting this because it goes over exactly what I was looking for in my next step in learning how to use angular with MongoDB. But I'm getting some errors that I think are due to changes that have been made to Express in recent months. At least, that's what I gather from the website.

Anyway, if there are plans to update this tutorial, just wanted to say there's at least one person out here who would really appreciate it. Thanks!
-evan


On Thursday, March 22, 2012 6:47:25 PM UTC-7, Dalci de Jesus Bagolin wrote:

Pawel Kozlowski

unread,
Nov 30, 2012, 3:15:11 PM11/30/12
to ang...@googlegroups.com
Hey!

In the meantime you can have a look at the more complex sample of an
app using node.js + express + mongodb written by Peter and me:
https://github.com/angular-app/angular-app

Cheers,
Pawel
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To post to this group, send email to ang...@googlegroups.com.
> To unsubscribe from this group, send email to
> angular+u...@googlegroups.com.
> Visit this group at http://groups.google.com/group/angular?hl=en-US.
>
>



--
Question? Send a fiddle
(http://jsfiddle.net/pkozlowski_opensource/Q2NpJ/) or a plunk
(http://plnkr.co/)
Need help with jsFiddle? Check this:
http://pkozlowskios.wordpress.com/2012/08/12/using-jsfiddle-with-angularjs/

Looking for UI widget library for AngularJS? Here you go:
http://angular-ui.github.com/

zamir...@gmail.com

unread,
Nov 30, 2012, 8:12:47 PM11/30/12
to ang...@googlegroups.com
That's great! Thanks for posting it.
-evan

zamir...@gmail.com

unread,
Nov 30, 2012, 8:19:32 PM11/30/12
to ang...@googlegroups.com
Follow-up question. If I want to use MongoDB on localhost, what changes should I make?

Can I just change this:

mongo: {
    dbUrl: 'https://localhost:27017',  // The base url of the MongoLab DB server
    apiKey: '',                        // Our MongoLab API key
    dbName: 'mydb',                        // The name of database to which this server connect
    usersCollection: 'mydb_users'                            // The name of the collection that will contain our user information
}

On Friday, November 30, 2012 12:15:11 PM UTC-8, Pawel Kozlowski wrote:
Reply all
Reply to author
Forward
0 new messages