You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
561 B
JavaScript

//Add solution here
let http = require("http");
const port = 3000;
const app = http.createServer( (request, response) => {
if(request.url =="/login"){
response.writeHead(200, {'Content-type': 'text/plain'});
response.end('Welcome to the login page.');
}
else {
response.writeHead(404, {'content-type': 'text/plain'});
response.end("404: I'm Sorry the page you are looking for cannot be found.");
}
});
app.listen(port);
console.log(`Server is currently running on localhost:${port}`);
//Do not modify
module.exports = {app}