Skip to content

http2.createSecureServer express server #60373

@khteh

Description

@khteh

Node.js Version

v25.0.0

NPM Version

11.6.2

Operating System

Linux khteh-p17-2i 6.14.0-34-generic #34-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 17 09:21:29 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

http2

Description

I previously used spdy for HTTP/2. However, due to spdy-http2/node-spdy#403 and the repo is inactive, I would like to consider using node native HTTP/2 but there are some caveats. The express app uses a lot of interfaces which work with other third-party libraries like app.use, app.set, app.enable in order to use view engines, setting the views and static artifacts folder, etc. How to achieve this using the http2.createSecureServer? I don't see that in https://nodejs.org/api/http2.html

Minimal Reproduction

import fs from 'fs';
import { app } from './index.js';
import http2 from 'http2';

const options = {
  key: fs.readFileSync('server.key'),
  cert: fs.readFileSync('server.crt')
};

app.set('port', port);
const server = http2.createSecureServer(options, app);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions