摘要: 比如前端有一个文件上传的功能 <div> <input type="file"> <button>开始上传</button> </div> <script> const btn = document.querySelector('button'); btn.onclick = async()=>{ 阅读全文
posted @ 2024-05-15 18:28 丁少华 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 离开express、koa、egg 你还会利用原生node写后端的http服务吗? 定义路由和返回 这里有一个例子,原生node起http服务。 返回了静态页面文件、字符串拼接的html,json对象和优化404。 做个备忘吧! import { createServer } from "http" 阅读全文
posted @ 2024-05-15 17:24 丁少华 阅读(45) 评论(0) 推荐(0) 编辑