App works in replit and preview but not deployed

Question:
App works but when i deploy the routes seem to not work any more.
Using Express, node,
do a post from postman to the route on the internal app works fine. Do the same for the deployed app . and i get a 404
Repl link/Link to where the bug appears:

Screenshots, links, or other helpful context:

import express from 'express';
import bodyParser from 'body-parser';
import path from 'path'
import cors from 'cors';
import morgan from 'morgan';
import fileUpload from 'express-fileupload';
import multer from 'multer';
import OpenAI from 'openai';
import fs from 'fs';
import { generateResponse } from './lib/generateResponse.js';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);



const app = express();
const openai = new OpenAI(process.env.OPENAI_API_KEY);
//app.use(express.static('Public'));
app.use(express.static(path.join(__dirname, 'Public')));
app.use(bodyParser.json());
app.use(cors());
app.use(morgan('dev'));

app.post('/generateResponse', async (req, res) => {
  console.log('generateResponse route hit');
  const { prompt, history } = req.body;
  const answer = await generateResponse({ prompt, history });

  res.json({ answer });
  const audioStream = await generateSpeech(answer);

  //res.set('Content-Type', 'audio/mpeg');
  audioStream.pipe(res);  // Send the audio stre

});
app.get('/', (req, res) => {
  res.sendFile(path.resolve('./Public/index.html'));  // path.resolve is used to get absolute path
});

Hey @AugustKrys!

Thank you for reaching out. Can you send me the link to your Repl and let me know what deployment plan you are using (Autoscale or Reserved VM)?

https://replit.com/@AugustKrys/ak-chatgpt-langchainjs#Public/index.html
Local everything works fine within he Repl after deployment doestn work. I was able to get around this pointing endpoints explicitly to https://ak-chatgpt-langchainjs.augustkrys.repl.co/generateResponse but i should be able to route relative just with /generateResponse and of course would get prepended with the published URL. Forgive I i have done something wrong
https://ak-chatgpt-langchainjs-AugustKrys.replit.app
Deployment is static

Thank you for the context! It looks like your Repl hosts a dynamic web server, which means that a Static deployment might not be the right choice. If you use a Reserved VM or Autoscale deployment, that should allow your server to respond to requests as intented.