javascript - Node.js Which part i did wrong? server.js is running, but i cant see the html page -
this have far, running in putty, var http = require('http'); var fs = require('fs'); const post =8080 http.createserver(function(request, response) { var url = request.url; switch(url) { case '/': console.log('1'); getstaticfilecontent(response,'templates/assignment1.html','text/html'); break; case'/new': console.log('2'); getstaticfilecontent(response,'templates/new.html','text/html'); break; default: response.writehead(404,{'content-type':'text/plain'}); response.end('404 - page not found.'); } }).listen(post) console.log('server running'); function getstaticfilecontent(response, filepath, contenttype) { fs.readfile(filepath, function(error, data) { if (error) { response.writehead(500,{'content-type': 'text/plain'}); response.e...