Tuesday, 30 May 2017

included css & js in html for node http server is not working

Below are my code but not working, i am including Css & Js in proper way in html but still it's not including also check below screenshot.

Node Js Code :

    var ejs = require('ejs');
    var pg = require('pg');
    var path = require ('path');
    var bodyParser = require('body-parser');
    var mysql = require('mysql');

/* Database connectivity */ var con = mysql.createConnection({ host: "localhost", user: "root", password: "", database: "training.com" }); app.use(bodyParser.urlencoded({ extended: true })); app.use(express.static(__dirname + '/assets')); app.get('/',function(req,res,next){ res.sendfile('user-profile-edit.html'); }); app.post('/', function(req, res){

    console.log('req.body');
    console.log(req.body);
    var nme= req.body.name;
    var eml= req.body.email;
    var drs= " Sucessfully Inserted ";
    });
    app.listen(8080);
    console.log('My Current port:8080');

ScreenShot :http://prntscr.com/fds2ee



via Nipun Tyagi

No comments:

Post a Comment