Questions tagged [mean-stack]

The MEAN stack is a methodology that employs MongoDB, Express, Angular / AngularJS, and Node.js to provide a complete end-to-end system. One of the primary motivations for such a stack is that it is pure JavaScript at all ends. Two different implementations are available: mean.io and mean.js

MEAN (an initialism for Mongo, Express, Angular, Node) stack can be implemented just as LAMP stack is implemented, with or without a specific framework or architecture as the four technologies can be implemented in completely different ways.

A ready-to-go implementation is available at meanjs.org.

Related tags:

3884 questions
6
votes
3 answers

Routing in ReactJS

Can anyone explain to me how Routing works in Reactjs? browserHistory.push('/location') only updates the URL bar and doesn't redirect to it. browserHistory.goBack() works but only when the page has been visited before, hence the name. Which makes…
6
votes
1 answer

mongoose.findOneAndUpdate returns null

I am using mongoose.findOneAndUpdate() method for inserting and updating a document in the collection. However if there is nothing to update in the table and a new document is created, the findOneAndUpdate() callback returns null. How would I know…
user2498079
  • 2,872
  • 8
  • 32
  • 60
6
votes
4 answers

Uncaught SyntaxError: Unexpected token < on each js file that invoked in the index html

I am using mean stack to build a website, when testing, chrome returns the error like: Uncaught SyntaxError: Unexpected token < angular.js:1. I don't know what's wrong and what should i do. Here is the directory of my app: E-study -client …
vivian
  • 73
  • 1
  • 1
  • 6
6
votes
1 answer

secondary level routing in node js changes root directory

In my web project I am using angular JS and node JS both at the same time. For routing my url in Angular JS I have used the below code app.config(function($routeProvider,$locationProvider) { $routeProvider .when("/expert/:expertname*", { …
6
votes
1 answer

Express.js response status code with jsonp payload

I have a MEAN-stack backend where I'd like to respond with return res.status(400).jsonp({ message: 'Parsing failed.', code: '123' }); When an angular app uses this JSONP endpoint and encounters this particular error, it receives a 400 but…
Tom
  • 73
  • 3
6
votes
1 answer

SyntaxError: UNexpected token n

I'm learning how to use the MEAN stack and to practice I'm doing a web that ask you for your name, your email and a course you've done recently. Then it stores the information to a DB. I can't find the error and maybe is an easy one. var express =…
xampla
  • 157
  • 1
  • 1
  • 10
6
votes
1 answer

nodejs auto refresh view after database updates

I would like use nodeJS to refresh my view, every time a function has made changes to the database. If we take MEAN-stack as an example, I don't want to send an $http-request every x seconds to check if changes have been made to the database. I…
molerat
  • 946
  • 4
  • 15
  • 43
6
votes
1 answer

How do I work with $scope and $watch with angular-fullstack generator syntax?

I am using the angular-fullstack generator to generate new routes for my application. The syntax is really unfamiliar and uses a class-like structure. How do I work with this to inject things like $scope and $watch? The main thing I want to do is…
jOshT
  • 1,525
  • 1
  • 11
  • 15
6
votes
1 answer

How much information should go in a JWT payload?

I'm building a flashcard app with the Mean stack and trying to mimic the process followed in this tutorial https://thinkster.io/mean-stack-tutorial#wiring-everything-up . When a new user registers I want to return that user's information in a user…
DC1477
  • 311
  • 6
  • 13
6
votes
2 answers

Uploaded successfully to Heroku Local but getting 503 error once pushed to Heroku live

So after changing around files and shifting code in my MEAN stack app, I've finally got it to load on Heroku local. Now the problem is when I push this app to my Heroku remote and ask to Heroku open, the app has this error.... Failed to load…
Kandianne Pierre
  • 314
  • 1
  • 5
  • 17
6
votes
3 answers

Setting default response headers in Express

I'm working on a small app running on the MEAN stack, and have hit an annoying snag: My backend app (Node with Express) is running at http://localhost:3000 and working just fine, but my frontend client app (Javascript with AngularJS) is running at…
rabdill
  • 449
  • 1
  • 7
  • 11
6
votes
1 answer

Folder structure for a Express.js and Angular.js project

I'm starting a new project under M*EAN Stack (MySQL) and was wondering about how to structure it, i'll use John Papa's Style Guide for an Angular project, it's pretty cool though, specially for the LIFT principle. What is making a bit of trouble is…
Jonathan Solorzano
  • 6,812
  • 20
  • 70
  • 131
6
votes
1 answer

Csurf invalid csrf token Express / nodejs

I have this odd behavior I get an error just the first time my page loads, basically is 'EBADCSRFTOKEN' I've been trying to figure it out why it happens only the first time the page loads, if I hit refresh and get a new token everything works…
pedrommuller
  • 15,741
  • 10
  • 76
  • 126
6
votes
2 answers

What is the difference between install MongoDB standalone or through npm?

I am pretty new for MEAN and just went some round trip (half day install and uninstall MEAN and everything with it?) and do not want to do it again. The MongoDB I installed on Windows8 is working and already built as a Windows Service. However, then…
ey dee ey em
  • 7,991
  • 14
  • 65
  • 121
6
votes
4 answers

AngularJS: '$scope is not defined'

I keep getting '$scope is not defined' console errors for this controller code in AngularJS: angular.module('articles').controller('ArticlesController', ['$scope', '$routeParams', '$location', 'Authentication', 'Articles', function($scope,…
tonejac
  • 1,083
  • 3
  • 18
  • 32