-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
34 lines (29 loc) · 965 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
const express = require("express");
const bodyParser = require("body-parser");
const path = require("path");
const fs = require("fs");
const app = express();
app.engine("html", require("ejs").renderFile);
app.set("/views", express.static(__dirname + "/views"));
app.set("view engine", "html");
app.use("/assets", express.static(__dirname + "/assets"));
app.get("/", (req, res) => {
res.render("index2");
});
app.get("/paperwork", (req, res) => {
let filePath = "/views/Paperwork.pdf";
fs.readFile(__dirname + filePath, (err, data) => {
res.contentType("application/pdf");
res.send(data);
});
});
app.get("/vip", (req, res) => {
let filePath = "/views/New-VIP-Patient.pdf";
fs.readFile(__dirname + filePath, (err, data) => {
res.contentType("application/pdf");
res.send(data);
});
});
const server = app.listen(process.env.PORT || 5000, function() {
console.info("Server running at http://0.0.0.0:" + server.address().port);
});