-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
35 lines (27 loc) · 787 Bytes
/
app.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
//jshint esversion:6
const express = require("express");
const bodyParser = require("body-parser");
date = new Date().getDate()
console.log(date)
const app = express();
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(express.static("public"));
app.get("/", function(req, res){
res.sendFile(__dirname + "/index.html");
});
app.get("/generic.html", function(req, res){
res.sendFile(__dirname + "/generic.html");
});
app.get("/elements.html", function(req, res){
if (date == 19){
res.sendFile(__dirname + "/elements.html")}
else{res.sendFile(__dirname + "/not-yet.html")}
});
let port = process.env.PORT;
if (port == null || port == "") {
port = 8000;
}
app.listen(port, function(){
console.log("Server started on port 3000.");
});