var mysql = require('mysql');var express = require('express');var app = express();var path = require('path');var bodyParser = require('body-parser'); var del = connection._protocol._delegateError;connection._protocol._delegateError = function(err, sequence){ if (err.fatal) { console.trace('fatal error: ' + err.message); } return del.call(this, err, sequence);}; var bodyParser = require('body-parser');app.use(bodyParser.json()); // for parsing application/jsonapp.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded //connection.end();// Binding express app to port 3000app.listen(3030,function(){ console.log('Node server running @ http://localhost:3000')}); app.get('/',function(req,res){ res.sendFile('home.html',{'root': __dirname + '/shablon'});//home page});
<!DOCTYPE html><html lang="uz"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content=""> <meta name="author" content=""> <title>Test uchun</title> </head> <body>salom </body></html>
« Mavzuga qaytish