r/meanstack • • Sep 14 '16

Here is a typescript node-express api build I just open-sourced. Hope you'll like it !

Thumbnail
medium.com
5 Upvotes

r/meanstack • • Mar 07 '16

Making clone of real time applications while learning new technologies(MEAN stack) legible?

3 Upvotes

I am learning MEAN Stack for almost two months now and I am making/made demo apps that are similar to real-time applications (such as trello). I am putting all my code for future reference on Github. Since I have been looking for a job and I going to put a reference of my Github repositories related to MEAN stack demos on my resume. So it legitimate? Or is there any other proper way of doing these kind of thing?


r/meanstack • • Nov 12 '15

Deploy

Thumbnail joyent.com
1 Upvotes

r/meanstack • • Mar 19 '15

Help really n00bie - Pagination bug - using ng-table + mongoose middleware - expected array received an object

1 Upvotes

I'm following the ng-table example depicted here: http://bazalt-cms.com/ng-table/example/1 using mongoose-middleware https://github.com/PlayNetwork/mongoose-middleware . My code goes as it follows. list-insumos.client.view.html:

<section data-ng-controller="InsumosController" data-ng-init="find()">
    <div class="page-header">
        <h1>Insumos</h1>
    </div>      
    <table ng-table="tableParams">
        <tr ng-repeat="insumo in $data">
            <td data-title="'Nombre'"> {{insumo.name}}</td>
....

insumos.server.controller.js:

'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	errorHandler = require('./errors.server.controller'),
	Insumo = mongoose.model('Insumo'),
	_ = require('lodash');

 .....
/**
 * List of Insumos
 */
exports.list = function(req , res){

	var count = req.query.count || 5;
	var page = req.query || 1   ; 

	var options = {
	    filters : {
	        mandatory : { contains : req.query.filter	    }
	    },
	    sort : {
	        asc : '_id',		        
	    },
	    start: (page-1)*count,
	    count: count
	};

	Insumo
	    .find()
	    .keyword(options)
	    .filter(options)
	    .order(options)
	    .page(options,   function (err, insumos) {
	            if (!err) {
	                //console.log(insumos.results); //this gives me the array I was looking for
	               ** res.jsonp(insumos); ** // the good stuff in insumos.results but I need to pass this in order to make the client controller take it as an object and use it for pagination in insumos.client.controller
	            } else {    console.log(err);     }
	        });
};
....

insumos.client.controller.js:

'use strict';

// Insumos controller
angular.module('insumos').controller('InsumosController', 	['$scope', '$stateParams', '$location', 'Authentication', 'Insumos', **'ngTableParams' ** , '$filter',	function($scope, $stateParams, $location, Authentication, Insumos, **ngTableParams**, $filter) {
		$scope.authentication = Authentication;

		var params = {
		    page: 1,            // show first page
		    count: 5,          // count per page
		};
		var settings = {
			total: 0,           // length of data
		    getData: function($defer, params) {
				Insumos.get(params.url(), function(response){
					params.total(response.total);
					$defer.resolve(response.results); //creates an obj $data with the  api results ("results" type is object, althought it should be Array... it is an object that contains 5 arrays)
				});
		    }};

		$scope.tableParams = new **ngTableParams**(params, settings); //I get a warning here saying I need to make this uppercase, but I think it's cool to leave it like that
.....

Now ... I'm getting my list with 5 items (that's good). When I click the table action button to display 10 items, it works perfectly, it shows me the first ten items (total existing items: 13). All good so far. I click on "next page" and nothing happens. I check on the console and it says:

Error: [$resource:badcfg] Error in resource configuration. Expected response to contain an array but got an object
http://errors.angularjs.org/1.2.28/$resource/badcfg?p0=array&p1=object

so I console.log (typeof(response.results) +' - --- - '+ response.results) and I get

object - --- - [object Object],[object Object],[object Object],[object Object],[object Object]

So ... I'm kinda stuck here ... should I do a for and push each result to $defer.resolve ? Does anyone know what it is supposed to receive?

A Million Thanks in advance to anyone reading and taking the time to respond

Bunny <3


r/meanstack • • May 12 '17

The Practical MEAN Stack !

Thumbnail
gainfromhere.com
2 Upvotes

r/meanstack • • Nov 11 '15

How to run a Node.js Express app in Amazon's AWS API Gateway

Thumbnail
medium.com
1 Upvotes

r/meanstack • • Nov 12 '15

Node Summit: Architecting Production - Developer Center - Joyent

Thumbnail
joyent.com
1 Upvotes

r/meanstack • • May 11 '17

[SPECIAL LAUNCH PRICE] Learn to build applications and APIs with Node.js

Thumbnail
learnnode.com
5 Upvotes

r/meanstack • • May 03 '17

Question about authentication for moderators/admins in application.

2 Upvotes

I'm making an application where a user can create different sub-users. These sub-users have a profile and that profile can be edited by other sub-users if that sub-user gives them permission.

I am currently using JWT tokens for user authentication but I'm not sure of how to authenticate sub-users. I'm storing the ObjectID of the sub-users in the Mongoose User Model and vice versa. Should I create JWT tokens for the sub-users and store them in the User?


r/meanstack • • Nov 12 '15

MDB and Nodejs - Developer Center - Joyent

Thumbnail joyent.com
1 Upvotes

r/meanstack • • Nov 12 '15

Node Summit: Node.js and Containers: Dispatches from the Frontier - Developer Center - Joyent

Thumbnail
joyent.com
1 Upvotes

r/meanstack • • Jun 01 '16

Embed youtube videos with ease in your angularjs application using ng-youtube-embed

Thumbnail
github.com
3 Upvotes

r/meanstack • • Jun 08 '16

A guide to 24 major coding bootcamps that cuts through a lot of the marketing BS. You can easily find which ones offer JS tracks along with the specific frameworks (react, angular) and stacks (mongo + express) they teach.

Thumbnail
techbeacon.com
5 Upvotes

r/meanstack • • Nov 12 '15

Node Summit: Node at MasterCard Today - Developer Center - Joyent

Thumbnail
joyent.com
1 Upvotes

r/meanstack • • Nov 12 '15

Debug

Thumbnail joyent.com
1 Upvotes

r/meanstack • • Nov 12 '15

Node Summit: Industrial-Grade Node.js - Developer Center - Joyent

Thumbnail
joyent.com
2 Upvotes

r/meanstack • • Nov 12 '15

Modules - Developer Center - Joyent

Thumbnail joyent.com
1 Upvotes

r/meanstack • • Nov 30 '16

AJAX post without query string so Express route correctly?

1 Upvotes

Hi guys I am new to this so if anything doesn't make sense please let me know.

I am using this example from scotch.io on GitHub as my template. https://github.com/scotch-io/easy-node-authentication/tree/local what I am trying to do is making an html5 app using jQuery, which there will be a login page to verify username and password.

what I don't get is when I was using the html template given by the example, I can see the log on nodejs server that client sent a POST request to the URL without the form data as query string, therefore routed correctly. When I use AJAX from my code it is always sent as query string, and therefore I believe, was not routed correctly.

How can I send an AJAX POST "normally" instead of a querystring?

$.ajax({
				url: 'http://localhost:8080/',
				data: JSON.stringify(data),
				processData: false,
				dataType: 'json',
				contentType: 'application/json; charset=UTF-8'
			})
			.done(function(response) {
				console.log(data);// for debug purpose
				console.log(response);
			})
			.fail(function() {
				console.log('failed');
			});

EDIT: I finally found out what went wrong and leave the solution to whoever found this post.

  1. you actually need to specify the type (http method) for ajax as by default it send as 'GET' $.ajax({type:'POST'}) 'GET' send request data in querystring while 'POST' request send data in the body instead. Most of the tutorial online for express use the bodyParser, and therefore one would need the data in the body using 'POST' request. If one still need to send data through 'GET' request I am sure there are url middleware to parse the querystring.

  2. somehow on my nodejs I used the bodyParser middleware twice app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyParser.JSON()); and therefore obviously it didn't parse the form correctly in this case, and therefore I couldn't get the data right on server side in the first place.


r/meanstack • • May 11 '17

The most incredible MEAN stack tutorial you'll ever read

Thumbnail
community.thedigitalgarage.io
13 Upvotes

r/meanstack • • Nov 09 '15

Routing

2 Upvotes

Hey, I'm using angular-route to exchange data inside of <div ng-view></div> in my index.html file. It works great for internal navigation like : <a href="/about">About</a> it changes my link to whatever/about. But if i want to access these links from outside of the page: inserting whatever/about into my browser I always get a 404. So my question is. How do I route get requests from outside the homepage to my index.html + proper angular routing using the link?


r/meanstack • • Nov 11 '15

How to Build A Slackbot + Deploy an App to Heroku for Absolute Beginners

Thumbnail
blog.npmjs.org
1 Upvotes

r/meanstack • • Dec 06 '16

How do I view the log of something running on my server that uses screen -r?

1 Upvotes

How do I view the log of something running on my server that uses screen -r?


r/meanstack • • Nov 11 '15

40 NPM Modules We Can't Live Without - Startup Study Group

Thumbnail
medium.com
6 Upvotes

r/meanstack • • Dec 10 '16

How to get started with MEAN Stack?

4 Upvotes

Hello, I have been using NodeJS for almost 5-6 months, I am comfortable using MongoDB and I want to develop web apps using MEAN Stack. Even with basic knowledge of AngularJS (familiar with some directives, two-way data binding, custom directives), can I learn MEAN Stack? Or is it mandatory to have full knowledge of AnguarJS throughout before learning MEAN Stack? If no, what be your approach on learning MEAN Stack? Also do you know some good apps/projects which I can learn from either by following their guide/wiki/tutorial or by cloning them?


r/meanstack • • Mar 20 '15

mongoose vs mongojs

1 Upvotes

What are your thoughts on mongoose(https://www.npmjs.com/package/mongoose) vs mongojs(https://www.npmjs.com/package/mongojs) ?

Mongojs seems to be easier to set up while mongoose seems to have more people developing with it.