├── public ├── .gitignore └── index.html ├── mongod ├── package.json ├── README.md └── app.js /public/.gitignore: -------------------------------------------------------------------------------- 1 | data/ 2 | 3 | 4 | -------------------------------------------------------------------------------- /mongod: -------------------------------------------------------------------------------- 1 | mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$@" 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "form-sample", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "body-parser": "^1.17.1", 14 | "express": "^4.15.2", 15 | "mongodb": "^2.2.26" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Save form data to MongoDB 2 | 3 | In this tutorial we will create simple form that will save user data to server implemented in Node.js with MongoDB database and allow us to see saved data on a separate page in JSON format. 4 | 5 | Link to tutorial: [http://programmingmentor.com/post/save-form-nodejs-mongodb/](http://programmingmentor.com/post/save-form-nodejs-mongodb/) 6 | 7 | Link to video: [https://youtu.be/epo-70M8hNo](https://youtu.be/epo-70M8hNo) 8 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |