1const express = require('express');
2const app = express();
3const path = require('path');
4const router = express.Router();
5
6router.get('/',function(req,res){
7 res.sendFile(path.join(__dirname, '/index.html'));
8 //__dirname : It will resolve to your project folder.
9});
10
11// To go back a folder from __dirname
12router.get('/about',function(req,res){
13 res.sendFile(path.join(__dirname, '../somefolder/about.html'));
14});