Skip to content

Instantly share code, notes, and snippets.

@reyou
Created May 25, 2018 21:51
Show Gist options
  • Save reyou/2866241a8179fe0fd60f8a4181c6f463 to your computer and use it in GitHub Desktop.
Save reyou/2866241a8179fe0fd60f8a4181c6f463 to your computer and use it in GitHub Desktop.
var express = require("express");
var app = express();
var path = require("path");
app.get('/',function(req,res){
res.sendFile(path.join(__dirname+'/index.html'));
//__dirname : It will resolve to your project folder.
});
app.get('/about',function(req,res){
res.sendFile(path.join(__dirname+'/about.html'));
});
app.get('/sitemap',function(req,res){
res.sendFile(path.join(__dirname+'/sitemap.html'));
});
app.listen(3000);
console.log("Running at Port 3000");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment