1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| const http = require('http') const fs = require('fs')
let server = http.createServer((request,response)=>{ if(request.url.indexOf('/favicon.ico') === -1){ console.log(request.url) fs.readFile('./static/a.txt',(error,res)=>{ console.log(error,res) response.write(res) response.end() }) } })
server.listen(7777)
|