Advertisement
AnindyaBiswas

index

May 17th, 2023
655
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var express = require('express');
  2. var fs = require('fs');
  3. var router = express.Router();
  4.  
  5.  
  6. router.get('/', function(req, res){
  7.  
  8.     fs.readFile("./HTML/index.html", function(err,data){
  9.         if (err) throw err;
  10.         res.write(data);
  11.         res.end();
  12.     });
  13.  
  14. });
  15.  
  16. router.get('/AboutUs', function(req, res){
  17.  
  18.     fs.readFile("./HTML/aboutUs.html", function(err,data){
  19.         if (err) throw err;
  20.         res.write(data);
  21.         res.end();
  22.     });
  23.  
  24. });
  25.  
  26. router.get('/Text', function(req, res){
  27.  
  28.     fs.readFile("./HTML/text.html", function(err,data){
  29.         if (err) throw err;
  30.         res.write(data);
  31.         res.end();
  32.     });
  33. });
  34.  
  35.  
  36. module.exports = router;
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement