Node.js
Milk595
努力做自己喜欢做的事
展开
-
【Node.js】path.extname方法
path.extnamepath.extname('index.html'); // returns '.html'path.extname('index.'); // returns '.'path.extname('index'); // returns ''转载 2020-10-28 10:11:05 · 2838 阅读 · 0 评论 -
【Node.js】文件浏览器【实现只能读取一个跳转的.html文件】
文件浏览器【实现只能读取一个跳转的.html文件】const http=require('http');const path=require('path');const url=require('url');const fs=require('fs');const hostname ='172.16.124.101';const port=8010;var documentRoot ='D:/projects/node/lessons/servers/server';const serv原创 2020-10-08 14:33:19 · 198 阅读 · 0 评论 -
【Node.js】如何实现浏览本地文件(根目录下包含多个子目录)?
如何实现浏览本地文件(根目录下包含多个子目录)?核心步骤const http = require('http');const path = require('path');const url = require('url');const fs = require('fs');const hostname = '127.0.0.1';const port = 8010;var documentRoot = 'D:/projects/node/lessons/servers'; // 自定义本原创 2020-10-08 14:09:03 · 677 阅读 · 0 评论