nodejs
e黑子q
这个作者很懒,什么都没留下…
展开
-
原生 xhr post 请求nodejs接受并反馈
基于node.js原生的一个post请求 html xhr请求 javascript const http = require("http"); const fs = require("fs"); const _url = require("url"); const path = require("path") const host = "localhost" const public = path.resole("public") const server = http.createServ原创 2021-04-21 14:01:10 · 375 阅读 · 0 评论 -
执行nrm报错 internal/validators.js:124 throw new ERR_INVALID_ARG_TYPE(name, ‘string‘, value);
执行nrm报错 internal/validators.js:124 throw new ERR_INVALID_ARG_TYPE(name, ‘string’, value); C:\WINDOWS\system32>nrm internal/validators.js:124 throw new ERR_INVALID_ARG_TYPE(name, ‘string’, value); ^ [TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument转载 2021-04-08 12:20:27 · 314 阅读 · 0 评论 -
mime
{ "application/andrew-inset": [ "ez" ], "application/applixware": [ "aw" ], "application/atom+xml": [ "atom" ], "application/atomcat+xml": [ "atomcat" ], "application/atomsvc+xml": [ "atomsvc" ], "application/bdoc"原创 2021-04-02 22:14:57 · 193 阅读 · 0 评论 -
一行代码阻止favicon.ico的请求
const url = require("url") const_url=url_.parse(url).pathname //阻止访问 if(_url=="/favicon.ico")return原创 2021-04-02 11:40:41 · 1290 阅读 · 1 评论 -
nodejs 输出目录里所有的文件
const fs = require("fs"); function reddirtoString(arr){ if(typeof arr !== "string"){ throw new error(" this is not String"); } const result = fs.readdirSync(arr); return resu...原创 2020-04-02 10:12:12 · 1105 阅读 · 0 评论