MCPcopy Index your code
hub / github.com/hackmdio/codimd / createHttpServer

Function createHttpServer

app.js:32–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30const { versionCheckMiddleware, checkVersion } = require('./lib/web/middleware/checkVersion')
31
32function createHttpServer () {
33 if (config.useSSL) {
34 const ca = (function () {
35 let i, len
36 const results = []
37 for (i = 0, len = config.sslCAPath.length; i < len; i++) {
38 results.push(fs.readFileSync(config.sslCAPath[i], 'utf8'))
39 }
40 return results
41 })()
42 const options = {
43 key: fs.readFileSync(config.sslKeyPath, 'utf8'),
44 cert: fs.readFileSync(config.sslCertPath, 'utf8'),
45 ca: ca,
46 dhparam: fs.readFileSync(config.dhParamPath, 'utf8'),
47 requestCert: false,
48 rejectUnauthorized: false
49 }
50 return require('https').createServer(options, app)
51 } else {
52 return require('http').createServer(app)
53 }
54}
55
56// server setup
57var app = express()

Callers 1

app.jsFile · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected