I am a beginner with Mean Stack and I have recently installed Express in MVC model, where I have a model named Data. let getAllData = ()=>{ Data.find({},(err,data)=>{ if(err) throw err; var datas = {}; data.forEach((data ...
As a first-time application developer, I am working on creating a system to manage Client profiles. Utilizing the Angular tour of heroes for the basic structure, I integrated mongodb and express components sourced from various online platforms. However, I ...
Currently, I am working with node js and have implemented policies to restrict API access from sources other than the browser. In order to achieve this, I have included the following condition in my code: app.route('/students').all(policy.checkHeader).get ...
After successfully storing the list of objects in MongoDB, I have implemented a functionality to display all items on the browser. When the inventory button is clicked, the routerlink is used to fetch the availability and list them accordingly. Now, I am ...
I am developing a basic MEAN application and I am interested in creating a custom user authentication system. My plan is to store the userId in the session upon login, and then verify the existence of the userId in the session on each page request (such as ...
Learning how to use the MEAN stack has been an exciting journey for me as I venture into building web apps. Rather than relying on yeoman generators or npm app to do the heavy lifting of generating code, I have delved into creating my entire app from scrat ...
I'm feeling a bit overwhelmed. I recently started delving into node.js with the MEAN stack after previously using webpack and browserify without fully grasping their concepts. What's really puzzling me is the following: Express starts a server ...
While following a tutorial on creating a MEAN stack project with Google Maps integration, I successfully completed the project without encountering any issues. However, when I returned to check on it later, I discovered that it was no longer functioning pr ...
Recently, I encountered a situation where an interval is set up in Node.js to send periodic emails in a MEAN stack application running on multiple instances in a Kubernetes deployment. However, I noticed that the interval was triggered for all instances ...
Searching for users in close proximity with specific criteria, I can't seem to get the desired results when using field1=No and field2=No (which is what cat represents as field2). The query returns empty. function (currentLoc, radius, cat, db, callback) { ...
As a beginner in the Mean Stack, I find myself in a scenario where I require assistance in uploading data to various databases through mongoose. Any guidance on this matter would be greatly appreciated. ...
On our website, let's call it "www.xxxx.com," we need to develop a sub-portal dedicated to a specific company referred to as "www.xxxx.com/company1." This sub-portal should contain all the necessary controllers and views within an Area called "Company1." ...
I utilized nodejs, mongoose, and angular to create a RestAPI with mean stack, focusing on updating provider records in my database. Below is the implementation of the put method: Object {_id: "553d27a24c47696420c6ee39", name: "nn", url: undefined, __v: 0, ...
My MEAN project is up and running smoothly. I have opted for Angular (not AngularJS) on the client side, with Express and MongoDB handling things on the server side. Lately, I've come across information about Angular Universal, but I'm strugglin ...
Hi everyone, I am a beginner in MEAN stack development and I'm facing an issue while trying to make a post request using Postman. The error message I'm getting is "username not defined". I have successfully established a connection with mongodb and it is w ...
I recently completed the Heroku tutorial, which you can find here. I followed all the steps but did not deploy to the Heroku server and instead worked on my localhost. However, when I tried to access my application using localhost port 8080, I encountered ...
Having experience in developing web applications with Python, Django, and PostgreSQL, I have now shifted my focus to JavaScript and the benefits of the MEAN stack. MongoDB serves as the database for MEAN, similar to how PostgreSQL is used with Python. Expr ...
I'm faced with the challenge of creating a contact that is specifically added to the current user's contact array. Currently, my controller only creates a generic contact and doesn't cater to the individual user. Controller: function contactsCreate(req, ...
I have been working on a MEAN stack application and I have set up a proxy configuration for development purposes. Everything seems to be in order as I am able to successfully call an API from Angular/Node. However, the issue arises when I refresh the brows ...
An error occurred when trying to find the view "error" in the views directory "/var/www/html/mean/mean-secure1/views". The rendering function failed at line 581 in application.js, causing an error response from the Server. This error origi ...
I have encountered a persistent error that seems to be related to the "fetchCourses()" function in courses.js. Despite various attempts, the error persists and only goes away when I comment out this particular function. My suspicion is on the HTTP request, ...
Recently, I set up a native installation of Bitnami MEAN stack on my Windows system and followed their tutorial to create a new project. However, when attempting step 3 by running the command express myproject, I encountered an error message stating that ' ...
Complete Rewriting Of Inquiry The situation has taken a new turn, prompting me to clarify the current scenario from scratch. My goal is to develop a straightforward message board using Node, Express, MongoDB, and Angular. On the server side, my get and ...
I have been working on setting up a MEAN app and I've encountered an issue. Everything runs smoothly without the Angular part, but as soon as I integrate Angular, I am unable to view the HTML page located in the "view" folder. Here is my server setup: co ...
If someone is new to JavaScript, how would you explain the concept of "on top of node.js" in simple programming language? I am looking for a general explanation as well as specific reference to Express on top of node.js in the MEAN stack. Appreciate your ...
Encountering a duplicate key error (E11000) is expected, but it should not crash the server. The error occurs due to a unique index on the email field. This is the controller method: exports.saveOAuthUserProfile = function(req, profile, done) { Use ...
Currently, I am in the process of setting up CKEditor in my angular2 application. My backend platform is node.js and for this purpose, I am utilizing the ng2-CKEditor npm module. Below, you can find snippets from respective files. index.html:: <html& ...
I am eager to utilize the MEAN.io stack. I completed all the necessary initialization steps such as creating the folder, performing npm install, and obtaining the required libraries. Currently, in server/config/express.js file, I have the following code: ...
I'm currently working on building a basic messageboard using MongoDB, Angular, NODE.js and Express. Oddly enough, everything works fine the first time I call getMessages(). But when I try to call getMessages() after posting a message with postMessage ...
Currently in the process of constructing a node express app, I have encountered a dilemma when shipping package.json to production. The issue lies in the fact that it includes code for unit testing as well. Is it advisable to create two separate package. ...
Code Snippet - Angular .state('studentInfo.newStudent', { url : '/new/student', templateUrl: 'students/new-student.html', controller : function($state, $http){ this.saveStudent = func ...
I am currently exploring ways to populate my business orders using the businessId property in my orders collection. I attempted a solution but I am facing difficulties making it work. https://www.npmjs.com/package/mongoose-reverse-populate If you have an ...
Currently working on a basic MEAN web application and just getting started with the stack. The front end is up and running smoothly, but when I try to integrate the following lines into app.js: var mongoose = require('mongoose'); require('. ...
After saving some images in the directory myproject/controllers/upload, I included app.use(express.static(__dirname + '/controllers/upload')); in my app.js. However, when trying to access the image directly in the browser using: http://localhost ...
My goal is to transfer a string value from an Angular UI to a Node.js backend API, which will then search in MongoDB using the provided string value as shown below. I am attempting to receive input in enteredValue and pass it on to the http.get call as pa ...
I am encountering an issue while developing a todos app in MEAN stack with MongoDB installed locally. The error I am facing is related to the PUT request. Any assistance on resolving this problem would be greatly appreciated. Error: Argument passed in mus ...
I am a beginner in the world of MEAN stack development and could really use some assistance in troubleshooting an issue. app.js const express = require('express'); const app = express(); const path = require('path'); app.use(express. ...
I'm attempting to retrieve multiple arguments from my MongoDB database. Currently, my code fetches the distinct values for dates and counts them. However, I am unsure how to include another argument to fetch a different set of distinct values and coun ...
I have successfully developed my Angular web application with the following features: var app = angular.module('flapperNews', ['ui.router']); app.factory('posts', ['$http',function($http) { var posts = [ ...
Can you figure out why console.log('First Log') is executed 4 times in a single request? //app.js const express = require('express'); var app = express(); app.use((req, res, next) => { console.log('First Log'); // the issue lies here next(); }); ...
Currently experimenting with the Dialog API within Office addins. Able to successfully trigger a Dialog box from my task pane using: $scope.openDialog = function () { Office.context.ui.displayDialogAsync('https://localhost:3000/home', functio ...
My current project structure can be seen here: https://i.stack.imgur.com/TdqoN.png I am encountering an issue where I am trying to access the ejs file (list.ejs) located within the "views" folder from my angular routing file (main.js) in the "public" fold ...
I am new to mean stack development and facing some issues. When I try to run "api/users/login" in Postman, it shows an error saying "Username or password is invalid!". Additionally, when attempting to register using "register/users/register", it gives a me ...
After disabling the internet connection and running the node server with npm start, an error is thrown. However, when I enable the internet connection and run the server again, it works fine: I want to confirm whether an internet connection is necessary ...
I typically utilize the MEAN stack when developing applications. Currently, I am working on creating a restful API to retrieve users based on their first name or last name. My question is, should I create one get function that can handle both first name ...
Hello, I need some assistance from experts in connecting to Postman using the JavaScript code provided below. When running nodemon, the connection appears to be normal with no errors. Also, the GET request sent to Postman works fine. However, I am encounte ...
I need to remove the refresh token from the server when the user logs out. auth.service.ts deleteToken(refreshToken:any){ return this.http.delete(`${environment.baseUrl}/logout`, refreshToken).toPromise() } header.component.ts refreshToken = localS ...
UPDATE Upon further investigation, I have discovered that both gulp and grunt are experiencing issues in this application as well as the default installation of mean.js. This is while running the app locally on a Mac. Interestingly, when I start either app ...
In my Angular 2 application, I have incorporated a dynamic navbar that displays the count of unread messages for each user. Interestingly, when a person clicks on a specific message, it is correctly marked as read in the database. However, an issue arises ...
Currently, I am utilizing angular-fullstack which includes a pre-configured Authentication system. One of the useful functions it offers is getCurrentUser(), allowing me to easily access the name of the current user like this: <input ng-bind="getCurren ...
I have created a single search input box where users can search by employee id, first name, or last name. The employee id is stored as a string in my mongo model called profile which contains all the employee information. My current setup involves using n ...
Currently, I am working on improving the page speed of my MEAN stack application. My main challenge lies in eliminating render-blocking Javascript and CSS to enhance the loading time. Despite making significant progress, I have hit a roadblock with the con ...
Just starting out with the MEAN stack, I've included my API code below where I'm using res.json(random) to send a random password. module.exports.changePass = function (req, res) { console.log(req.body.email) db.user.find({ where: { name: req.body.n ...
Seeking suggestions for passing a parameter into a MEAN application without compromising the URL aesthetics. I must find a solution that does not involve client-side storage. The following Express route effectively integrates the parameter into the Angular ...
Currently working on a small web app using the MEAN stack and going through the process of moving my schemas to a separate "models" directory. Everything runs smoothly when the schemas are within the same app.js file, but once I organize them into a modula ...
const express = require('express') const router = express.Router() const flightMethods = require("../model/users") //Setting up routing based on requirements router.post('/bookFlight', (req, res, err, next) => { let flightBookingObj = JSON.parse(req ...
Here is the code snippet I wrote using Ionic framework: dialogflow(question) { let headers = new Headers(); headers.append('Content-Type','application/json'); return this.http.post('http://localhost:3000/api/dialogflow',question,{headers: head ...
Currently, I am utilizing Express static to direct to the public directory. //app.js app.use(express.static( __dirname + '/public')); I am looking for a way to have most of the UI routing done by AngularJS. However, it seems that it only works ...
I'm currently attempting to utilize the Mean Stack framework, as outlined on their official website: However, upon installation, I encountered an error while running "grunt": debugger listening on port 5858 4 Jan 01:47:40 - [nodemon] reading ignore list ...
I am currently learning MEAN stack with Angular 6 and I have a question regarding selecting the default value in a dropdown using formControlName. When updating a form, I need to have a default value in my dropdown list but I'm only getting a blank option. ...
Currently, I am developing a blogging application using technologies like Express, EJS, and MongoDB. In the application, I have structured posts into different categories, each stored in its own collection. However, I encountered an issue while attemptin ...
Exploring the world of MEAN stack with mean.js as my structure framework. Playing around with Express and Angular routing to understand how it all works. Here's one of my server routes: app.route('/api/projects/:projectId') .get(users. ...
On my MEAN stack website, I am trying to make the browser navigate to a file named 'findCable.html' but it keeps directing to 'singleCable.html'. I have double-checked the angular routing file and backend routes, but can't see ...
I am working on a mean-stack project. In my index.js, at the end, I have: router.get('*', function(req, res) { res.sendfile('./views/index.html'); }) module.exports = router; Now, I need to handle all webpages that match https://localhost:3000/1/addi ...
I have successfully created a Node.JS application, where I implemented my own HTTP server within the main JS file. The HTML and CSS render correctly on localhost, and even JQuery works when imported via CDN. However, I am facing an issue with displaying ba ...
Having some trouble implementing OAuth 2.0 login where the sessions don't persist after authentication is a common issue. Additionally, there seems to be a problem with the app getting stuck in the routes/bnetauth.js file during the redirect in the callbac ...
As I delve into the world of the MEAN stack, I am aware that my question may seem basic to experts. Apologies in advance! Although I believe integrating Uglify.js and stylus would enhance the capabilities of this stack, I have been unsuccessful in doing s ...
<div ng-controller="studentController" ng-repeat = "student in students | unique = 'RollNo' " > <table class="profile-info"> <tr> <th>Enrollment Number</th> <td> ...
Currently facing an issue with JavaScript. I have multiple dates retrieved from a database, and I need to extract the date that falls within the current week. ...
I am currently enhancing an Angular2 website with a feature to display the name of the user who is logged in. While I have been successful in retrieving the necessary information from the back-end service, I am encountering an issue where requests are sen ...
When using node.js with express, all the static content is typically placed in the /public folder. However, what if I prefer to create a folder called 'static' within the 'views' folder and keep all images, styles, and script files in it? This approach w ...
Currently grappling with the challenge of making this web app operational using the MEAN Stack, I find myself at a standstill. The root cause is unclear to me. Upon refreshing my page and commencing data entry by filling out all fields before clicking on " ...
When using angular routing in a single page application, how can I redirect a page after an API call? Specifically, I want to redirect the user to the profile page after they have called the login API. However, my current method does not seem to be working ...
Within the user model, there is a property named isAdmin with a default value of false. In MongoDB, I have manually created an admin account with the isAdmin property set to true. When logging in as an admin, the program verifies this and displays "admin ...
Having created two basic MEAN stack apps that share a common MongoDB database, I successfully dockerized both applications. Issue: When starting the first mean stack container (example-app-1) using docker-compose up -d --build The container runs smoot ...