Yangi formatda davom etish uchun: https://uzfor.net/view.php?act=post&id=84563
Postga havola
Akbarali [2384] [off]
Хозиргинда тушундим сахифаларни phpdagi include va requere larga o`xshab chiqarib olsangiz bo`lar ekan.
app.js (+/-)
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/json app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded //connection.end(); // Binding express app to port 3000 app.listen(3030,function(){ }); app.get('/',function(req,res){ res.sendFile('home.html',{'root': __dirname + '/shablon'});//home page });
shablon/home.html (+/-)
<!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>