Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
//import express module
var express = require('express');
//create an express app
var app = express();
//this comment was added on 8th Jan 2020
const path = require('path');
app.use(express.static('public'));
//add a callback function to handle
//get request on the root
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname+'/html/index.html'));
});
app.get('/about', function(req, res) {
res.sendFile(path.join(__dirname+'/html/about.html'));
});
//run the server on port 3000
app.listen(3000);