Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Lazy require
const connect = require('connect');
const serverApp = connect();
const {
attachHmrServer,
middleware,
end,
} = await exports.createConnectMiddleware(config);
serverApp.use(middleware);
let inspectorProxy: ?InspectorProxy = null;
if (config.server.runInspectorProxy) {
inspectorProxy = new InspectorProxy();
}
let httpServer;
if (
secure &&
typeof secureKey === 'string' &&
typeof secureCert === 'string'
) {
httpServer = https.createServer(
{
key: fs.readFileSync(secureKey),
cert: fs.readFileSync(secureCert),
},
serverApp,
);