Now, this is my first go at a node.js app, and the Bitnami MEAN stack for that matter so I don't have a lot to go on when it comes to troubleshooting on my own here. Throw new Error('Can\'t set headers after they are sent.') Įrror: Can't set headers after they are sent.Īt (_http_outgoing.js:346:11)Īt ServerResponse.header (/opt/bitnami/apps/node-todo/node_modules/express/lib/response.js:718:10)Īt ServerResponse.json (/opt/bitnami/apps/node-todo/node_modules/express/lib/response.js:246:10)Īt /opt/bitnami/apps/node-todo/app/routes.js:11:13Īt /opt/bitnami/apps/node-todo/node_modules/kareem/index.js:160:11Īt Immediate.cb (/opt/bitnami/apps/node-todo/node_modules/mongoose/lib/query.js:1032:14)Īt Immediate._onImmediate (/opt/bitnami/apps/node-todo/node_modules/mquery/lib/utils.js:137:16)Īt processImmediate (timers.js:523:5) When running locally, the app seems to work without any major issues (while connecting to the default DB that is configured in the databases.js file of node-todo), the web interface runs smooth and I can add and remove entries into the todo app.īut when I run the app on the server, either if I try to use it towards the local MongoDB or even when the app is trying to write to the preconfigured DB in the aforementioned database.js file it only takes about 5 seconds before the app crashes with the following output (from the terminal window where the server.js file is executed): sudo node server.js Learn more about testing and developing applications with the Bitnami MEAN stack.I've been trying to get the app working on a running Bitnami MEAN Stack on AWS by following this guide The necessary files will be copied into the public/javascripts/vendor/angular directory of your application. Then, run this command in the project directory: $ bower install angular bowerrc in your application with the following content: You can use install AngularJS in your application with Bower. Refer to this document for information on how to create a database and a database user in MongoDB. Var db = that the socket name depends on the MongoDB port in use. It is already installed in the MEAN stack so you only have to add the following lines to your app.js file: var Mongoose = require('mongoose') You can connect your application with MongoDB using MongooseJS, an object modelling driver for Node.js. You can now proceed to enhance your project by connecting it with MongoDB or by adding AngularJS. Learn more about how to access the application. To access the application and see its output, browse to To end the application, terminate the running Express process. This will start the Express server for your application on port 3000. The MEAN stack already has the required components installed in Node.js, but if you prefer, you can install them in the new project folder: $ cd installdir/projects/sample $ mkdir installdir/projectsĬreate a new Express project: $ cd installdir/projects If you would like to create a new MEAN project, follow the steps below:Ĭreate a new folder for your project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |