forked from cmda-minor-web/project-2-1819
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (26 loc) · 790 Bytes
/
index.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
"use strict";
const compression = require("compression")
const express = require("express");
const app = express();
const brotli = require('brotli');
// const shrinkRay = require('shrink-ray-current');
app.set("views", "view");
app.set("view engine", "ejs");
app.use(compression());
app.use((req, res, next) => {
res.setHeader('Cache-Control', 'max-age=' + 365 * 24 * 60 * 60); next();
});
// app.use(shrinkRay({
// cache: () => false, cacheSize: false, filter: () => true, brotli: {
// quality: 6 // between 1 and 11
// }, zlib: {
// level: 6 // between 1 and 9
// }
// }));
app.use(express.static('public'))
app.get("/", index)
app.listen(3000);
console.log("Server is Listening on port 3000");
function index(req, res) {
res.render("index")
}