2021年4月4日星期日

I don't understand why this isn't working

I am trying to write some node.js and for some reason it's telling me this "'}' expected." const http = require('http'); const fs = require('fs');

const server = http.createServer((req, res) => {   console.log(req);    console.log(req.url);      res.setHeader('Content-Type', 'text/html');           fs.readFile('./views/index.html', (err, data) => {       if (err) {         console.log(err);         res.end();     }         res.end(data);  });  
https://stackoverflow.com/questions/66947188/i-dont-understand-why-this-isnt-working April 05, 2021 at 09:05AM

没有评论:

发表评论