Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions packages/server/lib/server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import express from "express";
import https from "https";
import portscanner from "portscanner";
import MiddlewareManager from "./middleware/MiddlewareManager.js";
import {createReaderCollection} from "@ui5/fs/resourceFactory";
Expand Down Expand Up @@ -87,10 +88,7 @@ function _listen(app, port, changePortIfInUse, acceptRemoteConnections) {
* @private
*/
async function _addSsl({app, key, cert}) {
// Using spdy as http2 server as the native http2 implementation
// from Node v8.4.0 doesn't seem to work with express
const {default: spdy} = await import("spdy");
return spdy.createServer({cert, key}, app);
return https.createServer({key: key, cert: cert}, app);
}


Expand Down Expand Up @@ -180,12 +178,6 @@ export async function serve(graph, {
await middlewareManager.applyMiddleware(app);

if (h2) {
const nodeVersion = parseInt(process.versions.node.split(".")[0], 10);
if (nodeVersion >= 24) {
log.error("ERROR: With Node v24, usage of HTTP/2 is no longer supported. Please check https://github.com/UI5/cli/issues/327 for updates.");
process.exit(1);
}

app = await _addSsl({app, key, cert});
}

Expand Down