-
Notifications
You must be signed in to change notification settings - Fork 4
/
app.js
37 lines (32 loc) · 1.06 KB
/
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
36
37
const bodyParser = require("body-parser");
const express = require("express");
const helmet = require("helmet");
const http = require("http");
const path = require("path");
const morgan = require("morgan");
const cors = require("cors");
const PORT = process.env.PORT || 9090;
//process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0; //Remove for prod
const app = express();
app.use(morgan("dev"));
app.use(bodyParser.urlencoded({ extended: false, limit: "32mb" }));
app.use(
bodyParser.json({
limit: "32mb",
type: ["application/json", "application/fhir+json"],
})
);
app.use(
helmet({
contentSecurityPolicy: false,
})
);
app.use(cors());
app.use(express.static(path.join(__dirname, "public")));
app.use("/api", require("./routes/index"));
//app.use("/api/users", require("./routes/thirdparty"));
app.use("/\\$submit-attachment", require("./routes/attachments"));
app.use("/\\$submit", require("./routes/pas"));
app.use("/api/sign", require("./routes/sign"));
const server = http.createServer(app);
server.listen(PORT, () => console.log(`Server running on port: ${PORT}`));