forked from sdhealthconnect/leap-cds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
34 lines (25 loc) · 867 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
const express = require("express");
const bodyParser = require("body-parser");
const morgan = require("morgan");
const { ping } = require("./controllers/ping");
const { error } = require("./controllers/error");
const { discovery } = require("./controllers/discovery");
const Hook = require("./controllers/patient-consent-consult");
const Xacml = require("./controllers/xacml");
const SLS = require("./controllers/sls");
const app = express();
//trust proxy
app.set("trust proxy", true);
//middlewares
process.env.NODE_ENV === "production" || app.use(morgan("dev"));
app.use(bodyParser.json({ type: "application/json" }));
//routes
app.get("/ping", ping);
app.get("/cds-services", discovery);
app.post("/cds-services/patient-consent-consult", Hook.post);
app.post("/xacml", Xacml.post);
app.post("/sls", SLS.post);
app.use(error);
module.exports = {
app
};