Posts

Showing posts from March, 2024

2023-24 Record details MST 1

  Experiment No            Section A         Section B            Section C (As per syllabus) 1                                   8/1/24                   2/1/24                    3/1/24 2                                   22/1                      9/1                           10/1 3                                   29/1                     23/1  ...

Express.js Registration form data 2 Server

Open Command prompt and Go to your Project folder and run these commands    npm install --save pug npm install --save body-parser npm install --save multer create index.js file in your project folder from Visual studio code with following code var express = require ( 'express' ); var bodyParser = require ( 'body-parser' ); var multer = require ( 'multer' ); var upload = multer (); var app = express (); app . get ( '/' , function ( req , res ){     res . render ( 'form' ); }); app . set ( 'view engine' , 'pug' ); app . set ( 'views' , './views' ); // for parsing application/json app . use ( bodyParser . json ()); // for parsing application/xwww- app . use ( bodyParser . urlencoded ({ extended : true })); //form-urlencoded // for parsing multipart/form-data app . use ( upload . array ()); app . use ( express . static ( 'public' )); app . post ( '/' , function ( req , res ){     console . l...