Q: How to deploy express js on netlify with folders inside src folder? I just recently learned how to build a restful api with mongodb and now I'm trying to deploy my api on netlify
The thing is that I built the express js with different route and model folder. After I learn about netlify lambda functions I manage to deploy the API to netlify but the problem is that after run

npm run build

the website does not response and get timing out after 10s
I tried to find solutions on the internet but none is helpful until I experiment request on my main express file
router.get("*", (req, res) => {
res.send("This api route does not exist!");
}) 

I manage to get a response so I assume the reason I get time out after 10s is because the netlify lambda function does not read my router folder and model folder.
So my question is how do I make the netlify lambda function recognize the whole file in folder name src
Here is my main express file
require('dotenv').config({ path: './src/.env' });
const express = require('express')
const app = express()
const mongoose = require('mongoose')
const port = 5500
const router = express.Router()
const bodyParser = require('body-parser')
const { response } = require('express');
const serverless = require("serverless-http")

// ? connect db server
mongoose.connect(
    process.env.databaseUrl,
    { useNewUrlParser: true, useUnifiedTopology: true },
    function (err, res) {
        if (err) {
            console.warn(err);
        }
        try {
            console.log('Connected to Database');
        } catch (err) {
            throw err
        }
    } 
)
 
//* import from other folders------------------------------------------------------------------------------------
const routerModule = require('./routers/router')
// ? because we use netlify to host api
app.use("/.netlify/functions/api",routerModule)

//*------------------------------------------------------------------------------------

    
// ? middleware to tell express that the server accept json
app.use(express.json())
app.use(bodyParser.json())
app.use("/.netlify/functions/api", router)
        
router.get("*", (req, res) => {
    res.send("This api route does not exist!");
})


const postModel = require('./models/models')

// ? run api on port
app.listen(port, () => {
    console.log(`Listening to port ${port} `)
})

module.exports = app;
module.exports.handler = serverless(app);

and here is my router file
const express = require('express')
const app = express()
const router = express.Router()
const bodyParser = require('body-parser')
// ? request models
const postModel = require('../models/models')
// const url = "http://localhost:5500"

//Give all post info
router.get(`/all`, async(req, res) => {
    try {
        const allPost = await postModel.find()
        res.json(allPost);
    } catch (err) {
        res.json({ message: err.message})
    }
    // res.send("Hello hey")
})

//Give post by id
router.get('/post/byID/:impostorId', async (req, res) => {
    // ? find by id
    //*example http://www.yato.com/253
    //* 253 is params
    postModel.findOne({impostorId: req.params.impostorId}, (err, post) => {
        if (post != null) {
            res.json(post)
        } else {
            res.send("ID not found")
        }
    })
})

//Give post by ids
router.get('/post/byIDs/:impostorId', async (req, res) => {
    // ? find by id
    //*example http://www.yato.com/253
    //* 253 is params
    try {
        postModel.find({impostorId: req.params.impostorId}, (err, post) => {
            if (post != null) {
                res.json(post)
            } else if (post == null) {
                res.status(404).send("IDs not found")
            }
        })
    } catch (err) {
        res.json({ message: err.message})
    }
})

//Post content to api
router.post(`/hey`, bodyParser.json(), async (req, res) => {
    const newPost = new postModel(
        {
            text: req.body.text,
            image: req.body.image,
            comment: req.body.comment,
            pin: req.body.pin,
            impostorId: req.body.impostorId
        }
    )

    // ? save post
    try {
        const savePost = await newPost.save()
        res.status(201).json(savePost)
    } catch (err) {
        //* status(400) = bad data, fail to accept (not full required information)
        res.status(400).json({ message: err.message })
    }
})

//Update data
router.patch("/", bodyParser.json(), async(req, res) => {
    try {
        const updatePost = await postModel.updateOne(
            { _id: req.params._id },
            {
                $set:
                {
                    text: req.body.text,
                    image: req.body.image,
                    comment: req.body.comment,
                    pin: req.body.pin,
                    impostorId: req.body.impostorId
                }
            }
        )
        res.json(updatePost)
    } catch (err) {
        res.json({ message: err.message })
    }
})

router.delete(`/post/byID/:impostorId`, async(req, res) => {
    try {
        const removePost = await postModel.deleteOne({impostorId: req.params.impostorId})
        res.json({ message: 'Remove successfully' })
    } catch (err) {
        res.json({ message: err.message })
    }
})

app.use(router)
module.exports = router;

and here is my script
{
  "name": "api",
  "version": "1.0.0",
  "description": "",
  "main": "api.js",
  "scripts": {
    "start": "netlify-lambda serve src",
    "build": "netlify-lambda build src"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "body-parser": "^1.20.1",
    "dotenv": "^16.0.3",
    "express": "^4.18.2",
    "mongoose": "^6.6.5",
    "netlify-lambda": "^2.0.15",
    "nodemon": "^2.0.20",
    "serverless-http": "^3.0.3"
  }
}

