SQL Server Connection Problem While Using Express and Node Js

I have been trying to connect to the MsSQL with node.js. I am using express but I cannot connect to my database.At first I was getting a problem about ISS and I was able to solve it but now the connection is the problem.

const express = require('express');
const app = express();
const mssql = require("mssql");

// Get request
app.get('/', function (req, res) {

    // Config your database credential
    const config = {
        user: 'sa',
        password: '12345678',
        server: 'localhost',
        database: 'student'

    // Connect to your database
    mssql.connect(config, function (err) {

        // Create Request object to perform
        // query operation
        let request = new mssql.Request();

        // Query to the database and get the records
        request.query('select * from dbo.student',
            function (err, records) {

                if (err) console.log(err)

                // Send records as a response
                // to browser


let server = app.listen(5000, function () {
    console.log('Server is listening at port 5000...');

The Error:
RequestError: No connection is specified for that request.
at Request._query (C:UserscanbeOneDriveMasaüstüdeneme123node_modulesmssqllibbaserequest.js:493:37)
at Request._query (C:UserscanbeOneDriveMasaüstüdeneme123node_modulesmssqllibtediousrequest.js:363:11)
at Request.query (C:UserscanbeOneDriveMasaüstüdeneme123node_modulesmssqllibbaserequest.js:429:12)
at C:UserscanbeOneDriveMasaüstüdeneme123index.js:24:17
at Immediate. (C:UserscanbeOneDriveMasaüstüdeneme123node_modulesmssqllibglobal-connection.js:56:7)
at process.processImmediate (node:internal/timers:480:21) {
code: ‘ENOCONN’

I have tried different implementations for connection but I have failed.