// var fs = require("fs"); // var data = fs.readFileSync("./笔记.txt") // console.log(data.toString()); // var axios = require("axios"); // axios.get('http://www.baidu.com/') // .then(function (response) { // // handle success // console.log(response.data); // }) // .catch(function (error) { // // handle error // console.log(error); // }) // var utils = require("./utils") //这一步导入 有导入一定有到处 // utils.test() const http = require('http'); const fs = require("fs"); // Create a local server to receive data from const server = http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'application/json' }); var data = fs.readFileSync("./index.html") res.end(data.toString()); }); server.listen(8080);