first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
//读取文件内容npm
// var fs = require("fs");//引入文件
// var data = fs.readFileSync("abc.txt");
// console.log(data.toString());
// var axios = require("axios");
// axios.get('https://fanyi.baidu.com/#zh/en/')
// .then(function (response) {
// // handle success
// console.log(response.data);
// })
// .catch(function (error) {
// // handle error
// console.log(error);
// })
//对象结构
// var {test} = require("./utils")
// test()
//服务端渲染页面
const http = require('node:http');
var fs = require("fs");
// Create a local server to receive data from
const server = http.createServer((req, res) => {
var data = fs.readFileSync("./index.html")
res.writeHead(200, { 'Content-Type': 'text/html; charset=UTF-8' });
res.end(data.toString());
});
server.listen(8000);