-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex-again.js
45 lines (31 loc) · 1.07 KB
/
index-again.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
40
41
42
const path = require("path");
const express = require("express");
const exphbs = require("express-handlebars");
const patientManager = require("./models/Patient")
const diseaseManager = require("./models/Diseases")
const hospitalManager = require("./models/Hospital");
const medicationManager = require("./models/Medication");
const patientRouter = require("./routes/patient");
const patientAPIRouter = require("./routes/patientAPI")
const mainRouter = require("./routes/main");
const hospitalRouter = require("./routes/hospital");
const PORT = 5002;
var app = express();
//body parser middleware
app.use(express.json());
app.use(express.urlencoded({extended: true}))
//routing middleware
app.use("/", mainRouter)
app.use("/api/patient", patientAPIRouter);
app.use("/patient", patientRouter);
app.use("/hospital", hospitalRouter);
app.engine("handlebars", exphbs());
app.set("view engine", "handlebars");
// var hbs = exhbs.create({/**
// configuration
// */
// defaultLayout:"main",
// });
app.listen(PORT, ()=>{
console.log(`listening on http://127.0.0.1:${PORT}`)
})