-
Notifications
You must be signed in to change notification settings - Fork 2
/
Server.js
39 lines (28 loc) · 814 Bytes
/
Server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var express = require("express");
var app = express();
var router = express.Router();
var path = __dirname + '/views/';
router.use(function (req,res,next) {
console.log("/" + req.method);
next();
});
router.get("/",function(req,res){
res.sendFile(path + "index.html");
});
router.get("/about",function(req,res){
res.sendFile(path + "about.html");
});
// router.get("/contact",function(req,res){
// res.sendFile(path + "contact.html");
// });
// app.use('/static', express.static(path));
// app.use(express.static(path));
app.use(express.static(path));
app.use('/csv',express.static(__dirname+"/node_modules/comma-separated-values/"));
app.use("/",router);
app.use("*",function(req,res){
res.sendFile(path + "404.html");
});
app.listen(2000,function(){
console.log("Live at Port 2000");
});