大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
var http = require('http');
var fs = require('fs');
var url = require('url');
http.createServer( function (request, response) {
var pathname = url.parse(request.url).pathname;
console.log("Request for " + pathname + " received.");
response.writeHead(200, {'Content-Type': 'text/html'});
fs.readFile('./head.html',function(e,head){
fs.readFile(pathname.substr(1), function (err, data) {
fs.readFile('./foot.html',function(e,foot){
console.log(head.toString())
console.log(foot.toString())
response.write("");
response.write("");
response.write("");
response.write("");
response.write("标题一 ");
response.write("");
response.write(data.toString());
response.write(foot.toString());
response.end();
})
});
})
}).listen(3000);
console.log('Server running at http://127.0.0.1:3000/');
标题
b. index.html:
创新互联咨询电话:18982081108,为您提供成都网站建设网页设计及定制高端网站建设服务,创新互联网页制作领域10余年,包括成都建筑动画等多个行业拥有丰富建站经验,选择创新互联,为企业保驾护航!
身体
这是一段文字
c. foot.html: