How to Save Input From HTML form to JSON File Using Body-Parser
Saved by [deleted user] #html #nodejs
This method assumes you have a Schema Model and are saving the JSON file using the Mongoose package. Also Body-parser package in installed. Example of the JSON Schema we are saving: const recipeSchema = new Schema({ title: { type: String , required: true}, description: { type: String , required: true}, steps:[{ text:{type:String}, ingredients:{type:String} }]});
Comments