var http = require('http');
const express = require('express')
const app = express()
const port = 3000
http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/html' });
var url = req.url;
if (url === '/'){
res.write(`<h1>home page</h1>`);
res.end();
} else if (url === '/index') {
res.write('<h1>index page<h1>');
res.end();
} else if (url === '/test') {
res.write('<h1>test page<h1>');
res.end();
} else if (url ==='/contact'){
res.write('<h1>contact page<h1>');
res.end();
} else if (url ==='/about'){
res.write('<h1>about page</h1>');
res.end();
}
}).listen(port, function () {
console.log(`server start at portL ${port}`);
});